Message104455
| Author |
bda |
| Recipients |
Yaniv.Aknin, bda, exarkun, gregory.p.smith, neologix, nvetoshkin, pitrou, spiv |
| Date |
2010年04月28日.19:58:19 |
| SpamBayes Score |
0.0027554315 |
| Marked as misclassified |
No |
| Message-id |
<1272484701.85.0.595865281388.issue7978@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
I encountered this issue when trying to exit cleanly on SIGTERM, which I use to terminate background daemons running serve_forever.
In BaseServer, a threading.Event is used in shutdown, so it can block until server_forever is finished (after checking __serving). Since the SIGTERM interrupts the select system call, the event set is never reached, and shutdown hangs waiting on the event.
I've attached an example of the pattern I was trying to use in my server. There are several ways around the issue, but looking at the API it seems like this _should_ work, and in my experience all servers have clean-up code so it's a very common case. |
|