Ticket #42 (closed enhancement: fixed)

Opened 2 years ago

Last modified 2 years ago

return False when can't start new thread

Reported by: trac Assigned to: asaddi
Priority: major Milestone: flup.server-1.0.3
Component: flup.server Version: 1.0.2
Keywords: Cc:

Description

when can't start new thread, the thread.error will through out.

--- threadpool.py.bak 2009-10-27 17:29:44.000000000 +0800 +++ threadpool.py 2009-10-27 17:38:14.000000000 +0800 @@ -69,9 +69,13 @@

# Maintain minimum number of spares. while self._idleCount < self._minSpare and \

self._workerCount < self._maxThreads:

+ try: + thread.start_new_thread(self._worker, ()) + except thread.error, e: + return False

self._workerCount += 1 self._idleCount += 1

- thread.start_new_thread(self._worker, ()) +

# Hand off the job. if self._idleCount or allowQueuing:

Change History

10/27/09 09:26:05 changed by asaddi

  • status changed from new to closed.
  • resolution set to fixed.

Patch committed. Note however, your patch did not apply cleanly since you're using an outdated version of flup!