This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bda
Recipients Yaniv.Aknin, bda, exarkun, gregory.p.smith, neologix, nvetoshkin, pitrou, spiv
Date 2010-04-28.19:58:19
SpamBayes Score 0.00275543
Marked as misclassified No
Message-id <>
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.
Date User Action Args
2010-04-28 19:58:22bdasetrecipients: + bda, gregory.p.smith, spiv, exarkun, pitrou, nvetoshkin, neologix, Yaniv.Aknin
2010-04-28 19:58:21bdasetmessageid: <>
2010-04-28 19:58:20bdalinkissue7978 messages
2010-04-28 19:58:19bdacreate