Skip to content

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Oct 5, 2023

Fix a deadlock in test_socket when server fails with a timeout but
the client is still running in its thread. Don't hold a lock to call
cleanup functions in doCleanups(). One of the cleanup function waits
until the client completes, whereas the client could deadlock if it
called addCleanup() in such situation.

doCleanups() is called when the server completed, but the client can
still be running in its thread especially if the server failed with a
timeout. Don't put a lock on doCleanups() to prevent deadlock between
addCleanup() called in the client and doCleanups() waiting for
self.done.wait of ThreadableTest._setUp().
(cherry picked from commit 318f5df)

Co-authored-by: Victor Stinner vstinner@python.org

…10416)

Fix a deadlock in test_socket when server fails with a timeout but
the client is still running in its thread. Don't hold a lock to call
cleanup functions in doCleanups(). One of the cleanup function waits
until the client completes, whereas the client could deadlock if it
called addCleanup() in such situation.

doCleanups() is called when the server completed, but the client can
still be running in its thread especially if the server failed with a
timeout. Don't put a lock on doCleanups() to prevent deadlock between
addCleanup() called in the client and doCleanups() waiting for
self.done.wait of ThreadableTest._setUp().
(cherry picked from commit 318f5df)

Co-authored-by: Victor Stinner <vstinner@python.org>
@bedevere-app bedevere-app bot added tests Tests in the Lib/test dir awaiting review labels Oct 5, 2023
@vstinner vstinner enabled auto-merge (squash) October 5, 2023 18:53
@vstinner vstinner merged commit 8da3367 into python:3.11 Oct 5, 2023
@miss-islington miss-islington deleted the backport-318f5df-3.11 branch October 5, 2023 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants