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 socketpair
Recipients giampaolo.rodola, neologix, petri.lehtinen, pitrou, santoso.wijaya, socketpair
Date 2011-08-09.03:08:42
SpamBayes Score 1.287696e-05
Marked as misclassified No
Message-id <1312859323.82.0.218610556782.issue12463@psf.upfronthosting.co.za>
In-reply-to
Content
> Why do you say it "hangs"? It doesn't hang, it just waits for you to
> call serve_forever(): it's not a bug, it's actually a feature.

Okay, for my case, How I should correctly terminate thread?

Conditions:
1. signal may appear at any time
2. thread may become non-alive in any time - either before server_forever (due to exception) or after.

So, after breaking main loop, I should correctly "terminate" thread. I can not say if thread is running. checking isAlive is racy. Even when thread is alive, this is unknown if server_forever was called. Even if serve_forever was not called, we should not rely on calling this ones, because thread may be interrupted by exception before calling serve_forever.

Once again: why not to add patch suggested by Petri Lehtinen ?
History
Date User Action Args
2011-08-09 03:08:43socketpairsetrecipients: + socketpair, pitrou, giampaolo.rodola, neologix, santoso.wijaya, petri.lehtinen
2011-08-09 03:08:43socketpairsetmessageid: <1312859323.82.0.218610556782.issue12463@psf.upfronthosting.co.za>
2011-08-09 03:08:43socketpairlinkissue12463 messages
2011-08-09 03:08:42socketpaircreate