-
-
Notifications
You must be signed in to change notification settings - Fork 97
Should the new _serve_unservicable thread be daemon? #769
Copy link
Copy link
Closed
Labels
bugSomething is brokenSomething is brokenhelp wantedSomebody help us, please!Somebody help us, please!regressionSomething that worked earlier got broken in new releaseSomething that worked earlier got broken in new releasereproducer: missingThis PR or issue lacks code, which reproduce the problem described or clearly understandable STRThis PR or issue lacks code, which reproduce the problem described or clearly understandable STR
Metadata
Metadata
Assignees
Labels
bugSomething is brokenSomething is brokenhelp wantedSomebody help us, please!Somebody help us, please!regressionSomething that worked earlier got broken in new releaseSomething that worked earlier got broken in new releasereproducer: missingThis PR or issue lacks code, which reproduce the problem described or clearly understandable STRThis PR or issue lacks code, which reproduce the problem described or clearly understandable STR
❓ I'm submitting a ...
🐞 Describe the bug. What is the current behavior?
The most recent change in 11.0.0 that added a non-daemon thread makes the library harder to use through pytest. Specifically, I have an existing project that uses pytest to create a server in a fixture, and this thread is not closing at the end of pytest. I can hack around it by disabling the new feature (
cheroot.server.HTTPServer._serve_unservicable = lambda: None), but this definitely feels wrong.❓ What is the motivation / use case for changing the behavior?
I think that if the
_serve_unservicablethread was daemon it would make using this in tests easier. The side effect is that when shutting down a server it wouldn't drain the 503 responses; but prior to 11.x those didn't exist.💡 To Reproduce
Steps to reproduce the behavior:
I assume in my tests where I start and stop a server, some request is getting queued after I ask the server to stop and this test, rather than that being ignored is stopping the process from stopping.
💡 Expected behavior
I'd like to be able to start and stop servers in pytest fixtures without worrying about exact timing from client tests.
📋 Environment