Skip to content

[3.7] bpo-33613, test_semaphore_tracker_sigint: fix race condition (GH-7850) #9055

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

Closed

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Sep 4, 2018

Fail test_semaphore_tracker_sigint if no warnings are expected and one is received.

Fix race condition when the child receives SIGINT before it can register signal handlers for it.

The race condition occurs when the parent calls
_semaphore_tracker.ensure_running() (which in turn spawns the
semaphore_tracker using _posixsubprocess.fork_exec), the child
registers the signal handlers and the parent tries to kill the child.
What seem to happen is that in some slow systems, the parent sends the
signal to kill the child before the child protects against the signal.
(cherry picked from commit ec74d18)

Co-authored-by: Pablo Galindo Pablogsal@gmail.com

https://bugs.python.org/issue33613

…H-7850)

Fail `test_semaphore_tracker_sigint` if no warnings are expected and one is received.

Fix race condition when the child receives SIGINT before it can register signal handlers for it.

The race condition occurs when the parent calls
`_semaphore_tracker.ensure_running()` (which in turn spawns the
semaphore_tracker using `_posixsubprocess.fork_exec`), the child
registers the signal handlers and the parent tries to kill the child.
What seem to happen is that in some slow systems, the parent sends the
signal to kill the child before the child protects against the signal.
(cherry picked from commit ec74d18)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
@pitrou
Copy link
Member

pitrou commented Sep 4, 2018

Rejected. This isn't fixing a user-visible bug.

@pitrou pitrou closed this Sep 4, 2018
@miss-islington miss-islington deleted the backport-ec74d18-3.7 branch September 4, 2018 08:57
@miss-islington
Copy link
Contributor Author

@pablogsal and @pitrou: Backport status check is done, and it's a failure ❌ .

1 similar comment
@miss-islington
Copy link
Contributor Author

@pablogsal and @pitrou: Backport status check is done, and it's a failure ❌ .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants