Fix thread leak by switching to different Queue shutdown mechanism#794
Merged
webknjaz merged 1 commit intocherrypy:mainfrom Nov 7, 2025
Merged
Fix thread leak by switching to different Queue shutdown mechanism#794webknjaz merged 1 commit intocherrypy:mainfrom
webknjaz merged 1 commit intocherrypy:mainfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #794 +/- ##
==========================================
+ Coverage 79.60% 79.73% +0.12%
==========================================
Files 29 30 +1
Lines 4261 4268 +7
Branches 542 543 +1
==========================================
+ Hits 3392 3403 +11
+ Misses 726 722 -4
Partials 143 143 |
2bd953b to
97a240c
Compare
97a240c to
f44401a
Compare
6 tasks
This was referenced Nov 6, 2025
f44401a to
1f8262d
Compare
Author
|
OK, done. |
webknjaz
reviewed
Nov 7, 2025
Implementing correct shutdown() would involve copying too much code, so switch to the more traditional way of indicating shutdown to a thread reading from a Queue. Signed-off-by: Itamar Turner-Trauring <itamar@pythonspeed.com>
1f8262d to
8d1e5a0
Compare
Author
|
And I fixed the spelling issue too. |
Member
|
🎉 v11.1.2 just hit PyPI: https://pypi.org/project/cheroot/11.1.2/ |
Member
|
Aparrently, this feature broke a test in CherryPy: https://github.com/cherrypy/cherrypy/blob/7c6198e37cb81dabee4136b42ef6bda3215ed12a/cherrypy/test/test_conn.py#L800-L866. That test was trying to simulate getting a connection reset from the web server but not that it just keeps accepting connections, that never happens. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implementing correct
shutdown()would involve copying too much code, so switch to the more traditional way of indicating shutdown to a thread reading from aQueue.❓ What kind of change does this PR introduce?
📋 What is the related issue number (starting with
#)Resolves #769
Superseded and closes #778
❓ What is the current behavior? (You can also link to an open issue here)
The overload thread leaks in Python < 3.13.
❓ What is the new behavior (if this is a feature change)?
The thread no longer leaks.
📋 Other information:
📋 Contribution checklist:
(If you're a first-timer, check out
this guide on making great pull requests)
the changes have been approved
and description in grammatically correct, complete sentences