Ticket #4347 defect new
Creating threadpool and then daemonizing leads to uninformative hangs or crashes
| Reported by: | ivank | Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | core | Keywords: | threads |
| Cc: | Branch: | ||
| Author: | Launchpad Bug: |
Description
At least two users created a ThreadPool for their WSGIResource, but they wrote their .tac files so that the ThreadPool was instantiated before twistd daemonized. After twistd daemonized, they experienced that their WSGIResource was unresponsive or that twistd crashed. I *think* there's an example of a incorrectly-written .tac file at http://paste.pocoo.org/show/185480/ (note the strace linked below is from different code)
<mezo> I run django on twisted 10.0.0, I observe strange behaviour. If twistd is a daemon : http request hang under linux (twistd crash under mac os X), whereas when twistd isn't daemonize everything works correctly. <mezo> more information here http://pastebin.com/VaRcLyeR (with strace output)
Assuming my diagnosis is correct (I made some assumptions), it would be nice if there were an informative error message printed at some point. For example, before forking to daemonize, twistd could raise an error if the process owns threads. If this is impractical, this bug might just be a documentation bug.
