diff options
author | ianb <devnull@localhost> | 2007-08-13 21:32:19 +0000 |
---|---|---|
committer | ianb <devnull@localhost> | 2007-08-13 21:32:19 +0000 |
commit | 8f95e1273c6ac1ca254627ffb5b4cf2ae3a0bdb1 (patch) | |
tree | c44523af0a1b4c815a00ad7747303575c43f8668 /paste/httpserver.py | |
parent | 1cd91f0eca71e3f3df5712f96fdd4b21fad5f52b (diff) | |
download | paste-8f95e1273c6ac1ca254627ffb5b4cf2ae3a0bdb1.tar.gz |
Fix possible thread error, when a thread finishes while add_task is looking at it
Diffstat (limited to 'paste/httpserver.py')
-rwxr-xr-x | paste/httpserver.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/paste/httpserver.py b/paste/httpserver.py index 2bd9f4a..6309916 100755 --- a/paste/httpserver.py +++ b/paste/httpserver.py @@ -617,8 +617,8 @@ class ThreadPool(object): if not hasattr(worker, 'thread_id'): # Not initialized continue - if worker.thread_id in self.worker_tracker: - time_started, info = self.worker_tracker[worker.thread_id] + time_started, info = self.worker_tracker.get(worker.thread_id, (None, None)) + if time_started is not None: if now - time_started < self.hung_thread_limit: busy += 1 if busy < self.spawn_if_under: |