-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-90369: change test server threads to joinable #135560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
These were made daemons in an otherwise unrelated commit. The test code that joins them was not deleted and still works, so they can just be made joinable again.
This does not impact users in any way, so IIUC it doesn't need a NEWS entry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I understand, daemon threads are still useful even when joining, because they allow you to close them with a single CTRL+C. With a non-daemon thread, you have to interrupt it twice: once to stop the join in Python, and once more to stop the join by the interpreter.
What's the rationale here?
It prevents a potential crash if a broken test exits uncleanly and doesn't join, as per the code in the original issue, but this is all very theoretical, for sure. As I said in the issue: I would not normally consider this sort of change worthwhile, but it looked like the threads may have been made daemons by mistake1, it is a trivial change, and I was under the impression we2 prefer joinable threads, all being equal. If you or others don't think it is a good idea I am happy to withdraw it. Note that IMO #90369 should be closed regardless: it is doing things it shouldn't with internal test code. 1 Although, given your point about single CTRL-Cs, possibly it a convenience/QoL tweak by a dev who was frequently interrupting tests during development? |
Probably. IIRC, we do something similar for the |
As I said, I'm perfectly happy with that outcome. I'll leave it for a while in case anyone else wants to weigh in, especially the dev who changed them to daemon threads originally, but otherwise I'll close it myself if no-one else does first. |
These were made daemons in an otherwise unrelated commit. The test code that joins them was not deleted and still works, so they can just be made joinable again.