summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Saddi <allan@saddi.com>2007-07-14 09:16:42 -0700
committerAllan Saddi <allan@saddi.com>2007-07-14 09:16:42 -0700
commit9dd66a81c7250657713ae15f397ba78be81d0486 (patch)
treedc9fcca7988344ec65554b4c8338c183cc6e514c
parent089258c7c6527534bda7c3a4d354e8966c78478f (diff)
downloadflup-9dd66a81c7250657713ae15f397ba78be81d0486.tar.gz
Prevent ThreadPool inconsistences if an exception is actually raised.
-rw-r--r--.hgignore3
-rw-r--r--ChangeLog5
-rw-r--r--flup/server/threadpool.py7
3 files changed, 14 insertions, 1 deletions
diff --git a/.hgignore b/.hgignore
new file mode 100644
index 0000000..807a7ae
--- /dev/null
+++ b/.hgignore
@@ -0,0 +1,3 @@
+syntax: glob
+*.pyc
+*~
diff --git a/ChangeLog b/ChangeLog
index 788037b..fd09c95 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-07-14 Allan Saddi <allan@saddi.com>
+
+ * Prevent ThreadPool inconsistences if an exception is
+ actually raised. Thanks to Tim Chen for the patch.
+
2007-05-17 Allan Saddi <allan@saddi.com>
* Fix fcgi_fork so it can run on Solaris. Thanks to
diff --git a/flup/server/threadpool.py b/flup/server/threadpool.py
index 28ec12f..a61885d 100644
--- a/flup/server/threadpool.py
+++ b/flup/server/threadpool.py
@@ -100,7 +100,12 @@ class ThreadPool(object):
self._lock.release()
- job.run()
+ try:
+ job.run()
+ except:
+ # FIXME: This should really be reported somewhere.
+ # But we can't simply report it to stderr because of fcgi
+ pass
self._lock.acquire()