-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
π Handle stray exceptions in worker threads #649
Merged
webknjaz
merged 6 commits into
cherrypy:main
from
webknjaz:bugfixes/358-unhandled-worker-thread-exc
Mar 31, 2024
Merged
π Handle stray exceptions in worker threads #649
webknjaz
merged 6 commits into
cherrypy:main
from
webknjaz:bugfixes/358-unhandled-worker-thread-exc
Mar 31, 2024
Conversation
This file contains 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
webknjaz
added
bug
Something is broken
backport-8.x
π€ Trigger automatic backporting into the `maint/8.x` release branch by the Patchback robot
labels
Mar 12, 2024
webknjaz
force-pushed
the
bugfixes/358-unhandled-worker-thread-exc
branch
from
March 13, 2024 10:39
d1f72d0
to
a11d38d
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #649 +/- ##
==========================================
+ Coverage 82.57% 83.58% +1.00%
==========================================
Files 28 28
Lines 4068 4172 +104
==========================================
+ Hits 3359 3487 +128
+ Misses 709 685 -24 |
webknjaz
force-pushed
the
bugfixes/358-unhandled-worker-thread-exc
branch
from
March 13, 2024 16:10
a11d38d
to
432a855
Compare
webknjaz
force-pushed
the
bugfixes/358-unhandled-worker-thread-exc
branch
6 times, most recently
from
March 24, 2024 00:03
c3e8592
to
aa64fe0
Compare
3 tasks
This patch aims to prevent a situation when the working threads are killed by arbitrary exceptions that bubble up to their entry point layers that aren't handled properly or at all. This was causing DoS in many situations, including TLS errors and attempts to close the underlying sockets erroring out. Fixes cherrypy#358 Ref cherrypy#375 Resolves cherrypy#365
This simulates a situation when the server attempts sending at least something useful to a connection with broken HTTP.
This documents the expected keyboard interrupt server shutdown handling sequence.
webknjaz
force-pushed
the
bugfixes/358-unhandled-worker-thread-exc
branch
2 times, most recently
from
March 27, 2024 19:00
56bad54
to
abde13f
Compare
This is to ensure that such exceptions don't leak into the internal worker thread logic.
This is to ensure that such exceptions don't crash the worker threads starving the server of the processing resources.
This is necessary since tests are more prone to linting exceptions.
webknjaz
force-pushed
the
bugfixes/358-unhandled-worker-thread-exc
branch
from
March 27, 2024 22:20
abde13f
to
a7665f3
Compare
This comment was marked as outdated.
This comment was marked as outdated.
webknjaz
added a commit
that referenced
this pull request
Apr 14, 2024
UPD: this change was released as a part of v10.0.1: #365 (comment). |
scyclops
added a commit
to scyclops/cheroot
that referenced
this pull request
May 3, 2024
@webknjaz I tried with cheroot v10.0.1 , still seeing same issue mentioned in cherrypy/cherrypy#2025 |
That's weird. Could you file an issue with a Cheroot-only reproducer? |
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport-8.x
π€ Trigger automatic backporting into the `maint/8.x` release branch by the Patchback robot
bug
Something is broken
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.
β What kind of change does this PR introduce?
π What is the related issue number (starting with
#
)Fixes #358
Ref #375
Resolves #365
β What is the current behavior? (You can also link to an open issue here)
A DoS would happen in many situations, including TLS errors and attempts to close the underlying sockets erroring out.
β What is the new behavior (if this is a feature change)?
This patch aims to prevent a situation when the working threads are killed by arbitrary exceptions that bubble up to their entry point layers that aren't handled properly or at all.
π Other information:
N/A
π 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
This change isβ