Opened 11 years ago

Closed 11 years ago

#3786 defect closed fixed (fixed)

trial forces the creation of a new threadpool with max size 0 after running a TrialSuite

Reported by: Jean-Paul Calderone Owned by:
Priority: high Milestone:
Component: trial Keywords:
Cc: Branch: branches/leave-threadpool-alone-3786
branch-diff, diff-cov, branch-cov, buildbot
Author: exarkun

Description overrides the base to call _bail after doing the normal run stuff. The _bail method does various Twisted-related cleanup - specifically it fires the shutdown event and waits for all shutdown triggers to complete, and it resizes the reactor threadpool to 0. This resize was introduced in r5030 in order to prevent trial from hanging at the end of the test suite waiting for non-daemon threads to exit (which never would by themselves). This is not necessary now that the reactor cleans up its own threadpool, and it causes problems since by resizing the threadpool to 0, it forces the creation of a new threadpool if the reactor has already cleaned its up. A size 0 threadpool isn't useful for anything since it can't run any jobs.

Change History (6)

comment:1 Changed 11 years ago by Jean-Paul Calderone

Author: exarkun
Branch: branches/leave-threadpool-alone-3786

(In [26732]) Branching to 'leave-threadpool-alone-3786'

comment:2 Changed 11 years ago by Jean-Paul Calderone

(In [26733]) Stop calling resizeThreadPoolSize(0) at the end of a TestSuite run

refs #3786

comment:3 Changed 11 years ago by Jean-Paul Calderone

Keywords: review added
Owner: Jean-Paul Calderone deleted

Did what I said. Build results

comment:4 Changed 11 years ago by Jonathan Lange

Keywords: review removed
Owner: set to Jean-Paul Calderone

Looks good to me. Thanks for the clear description of the problem in the bug report. Please merge.

comment:5 Changed 11 years ago by Jean-Paul Calderone

Resolution: fixed
Status: newclosed

(In [26734]) Merge leave-threadpool-alone-3786

Author: exarkun Reviewer: jml Fixes: #3786

Remove the trial TestSuite cleanup code which resizes the reactor's thread pool to 0. The reactors take care of their own thread pool cleanup and this resize is not only unnecessary, but it interfers with the process.

comment:6 Changed 10 years ago by <automation>

Owner: Jean-Paul Calderone deleted
Note: See TracTickets for help on using tickets.