-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-94609: Make test_ssl.ThreadedEchoServer exceptions appear in a main thread #92475
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
Open
arhadthedev
wants to merge
92
commits into
python:main
Choose a base branch
from
arhadthedev:threadedserver
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+337
−46
Open
Changes from all commits
Commits
Show all changes
92 commits
Select commit
Hold shift + click to select a range
ea5230f
Add a threaded server factory
arhadthedev c6e68e9
Add an alternative implementation of ThreadedEchoServer
arhadthedev 47ac053
Port two simple cases as an example
arhadthedev 05fd819
Port multiserver test_check_hostname
arhadthedev 149d18c
Port a case where client connects twice
arhadthedev e97b07c
Port a case where client connects four times
arhadthedev 4fa30f1
Fix a race between client connection and server launch
arhadthedev d5c4762
Add a temporary workaround for zero-byte SSL transfers
arhadthedev 289e563
Prevent hanging in case of client overexpectation
arhadthedev 9aa2bef
Fix more sporadic errors
arhadthedev bb750f3
Merge branch 'main' into threadedserver
arhadthedev d39fba9
Automatic thread management not only needs no manual leak detector, i…
arhadthedev a2f0b07
Use a named constant for a timeout
arhadthedev bbce667
Restore an unstable test
arhadthedev d10cc72
Restore the second unstable test
arhadthedev 18b3c15
Remove accidentally included comment fragment
arhadthedev 1c8a6f1
Add a NEWS entry
arhadthedev bbb7c6f
Fix a potential method name conflict between base and derived classes
arhadthedev beb1650
Remove a redundant parameter
arhadthedev 4b4b4e5
Revert "Restore the second unstable test"
arhadthedev 0f3663b
Forcefully release a thread after a module is over
arhadthedev a999eab
Account for a fact that assignments cannot be inside lambdas
arhadthedev 5e570f2
Split test_check_hostname to discover which one fails
arhadthedev 2ea2217
Teach the server to expect client errors on demand
arhadthedev 8c78bb9
Make sure that a heavy context object with captures does not pass thr…
arhadthedev 5dcea72
Teach the server to handle expectedly closed sockets
arhadthedev 535c54c
Fit threading_helper into 79 columns
arhadthedev a39981f
Use single quotation because there won't be any chance to fix it later
arhadthedev 2d7d843
Account that SSLError subclasses OSError
arhadthedev 1418cc3
Debug output of whatever happens with SSLError
arhadthedev 74bd397
(once again)
arhadthedev 2b3cabf
(and again)
arhadthedev 555bde6
SSLError seems to have nonzero errno - print it
arhadthedev 8578b98
Properly separate exceptions
arhadthedev 8858099
After all fixes, try to rely on natural garbage collection of thread …
arhadthedev 59773f8
Another attempt at threadpool cleanup
arhadthedev 29e6a6d
Make global threadpool explicit
arhadthedev c35630e
Another attempt
arhadthedev 0a67199
Merge two setUpModule copies
arhadthedev 02a1bc8
Explicit waiting on futures seem to destabilize a program
arhadthedev 5c15509
Fix incorrect pass of normal results from a server to a client
arhadthedev 0ce52ea
Merge branch 'main' into threadedserver
arhadthedev 404d120
Simplify expected exception regex
arhadthedev a2a526e
Show what really is thrown on macOS runner
arhadthedev c7a3f13
typo
arhadthedev 2caabcb
Context managers are not terminated after a `with` section
arhadthedev 70f8f90
Temporarily disable expected exception handling
arhadthedev 1f1da1e
Sort out discrepancy between macOS and others
arhadthedev 23cf45d
Final touch-ups
arhadthedev 2ee7b5a
Fix `SyntaxError: no binding for nonlocal '_thread_pool' found`
arhadthedev 30fdbc7
Merge branch 'main' into threadedserver
arhadthedev a77d6e4
Stabilize tests by forcing TLS handshake with empty data packets
arhadthedev 7e85ec8
Remove unnecessary wait_connection invocations
arhadthedev d167f1c
Temporarily show exact exception
arhadthedev 910083b
Revert "Temporarily show exact exception"
arhadthedev 458a0a6
An attempt to fix in-handshake connection abruption
arhadthedev 1fa3f0c
Reorder imports
arhadthedev 17c56dc
Fix potential infinite waiting on handshake enforcement
arhadthedev 37e3470
Debug why runners hang
arhadthedev 6b196f9
Try to remove server response waiting
arhadthedev 2152234
Discriminate when we need to wait server response
arhadthedev f4406cf
TEMPORARILY force full-fledged logging
arhadthedev 9f6e826
Add a socket timeout to not hang the whole test
arhadthedev 19486c9
Fix server-side echo
arhadthedev cad138b
Fix THE REAL REASON: sockets do not implement context managers hence …
arhadthedev 2bebeca
Merge branch 'main' into threadedserver
arhadthedev 4ced1f8
Run patchcheck.py
arhadthedev 78225c0
Reword a NEWS entry
arhadthedev eba78fa
Add socket timeout to all server-related tests
arhadthedev 5287287
Restore code removed while debugging
arhadthedev 71197b9
Restore more code
arhadthedev feb2b20
Try to replace server-side error swallow with client-side ignorance
arhadthedev e4c7fca
Clarify a purpose of wait_connection()
arhadthedev ed98010
A typo
arhadthedev cc1b400
Restore explicit server timeout; getdefaulttimeout does not propagate…
arhadthedev fd0468e
Try to fix the ENV CHANGED error probably caused by cleanup misorder
arhadthedev de27807
Add some debug scaffolding to track down a leaked thread
arhadthedev b410384
Avoid thread leaks by shutting down the pool
arhadthedev 2a44b2a
Revert "Avoid thread leaks by shutting down the pool"
arhadthedev 1f6378a
Remove threading control (a thread pool interferes with it)
arhadthedev 4f7b0e9
Revert "Add some debug scaffolding to track down a leaked thread"
arhadthedev f0e7c8d
On MacOS server that lost a client still raises an exception
arhadthedev c67bb1a
Clarify terms in NEWS
arhadthedev cdb9137
Streamline comments
arhadthedev fbacdc8
Set a default socket timeout globally
arhadthedev d6940b9
Merge branch 'main' into threadedserver
arhadthedev e526af4
Use sockets directly, without contextlib.closing
arhadthedev 78d725e
Merge branch 'main' into threadedserver
arhadthedev b8174ae
Put the news entry into a present tense
arhadthedev a551384
Merge branch 'main' into threadedserver
arhadthedev a3693f3
Merge branch 'main' into threadedserver
arhadthedev e4d35a5
Merge branch 'main' into threadedserver
arhadthedev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
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.
I've added
init()
to avoid amodified environment
test failure due to a leaked object. If there's a better solution, I'll use that instead.