Skip to content

Should the new _serve_unservicable thread be daemon?Β #769

@manthey

Description

@manthey

❓ I'm submitting a ...

  • 🐞 bug report
  • 🐣 feature request
  • ❓ question about the decisions made in the repository

🐞 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_unservicable thread 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

  • Cheroot version: 11.0
  • CherryPy version: 18.10.0
  • Python version: 3.9 through 3.13
  • OS: Ubuntu

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is brokenhelp wantedSomebody help us, please!regressionSomething that worked earlier got broken in new releasereproducer: missingThis PR or issue lacks code, which reproduce the problem described or clearly understandable STR

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions