Skip to content
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

gh-107851: Fix spurious failures in fcntl eintr tests #121556

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

colesbury
Copy link
Contributor

@colesbury colesbury commented Jul 9, 2024

On heavily loaded machines, the subprocess may finish its sleep before the parent process manages to synchronize with it via a failed lock.

This leads to errors like:

  Exception: failed to sync child in 300.3 sec

Use pipes instead to mutually synchronize between parent and child.

On heavily loaded machines, the subprocess may finish its sleep before
the parent process manages to synchronize with it via a failed lock.

This leads to errors like:

  Exception: failed to sync child in 300.3 sec

Use pipes instead to mutually synchronize between parent and child.
@colesbury
Copy link
Contributor Author

I tested this with the following command to heavily load 2 CPUs with 20 tests. This seems to fairly reliably reproduce the issue before this PR. I no longer see failures after this PR is applied.

taskset -c 0-1 ./python -m test -u all -j 20 test_eintr test_eintr test_eintr test_eintr test_eintr test_eintr test_eintr test_eintr test_eintr test_eintr test_eintr test_eintr test_eintr test_eintr test_eintr test_eintr test_eintr test_eintr test_eintr test_eintr

@colesbury colesbury added needs backport to 3.12 bug and security fixes needs backport to 3.13 bugs and security fixes labels Jul 9, 2024
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. It looks like real working synchronization code, whereas before, it was more an optimistic heuristic :-)

@colesbury colesbury merged commit af9f6de into python:main Jul 10, 2024
38 checks passed
@miss-islington-app
Copy link

Thanks @colesbury for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

@colesbury colesbury deleted the gh-107851-flock branch July 10, 2024 14:36
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 10, 2024
…-121556)

On heavily loaded machines, the subprocess may finish its sleep before
the parent process manages to synchronize with it via a failed lock.

This leads to errors like:

  Exception: failed to sync child in 300.3 sec

Use pipes instead to mutually synchronize between parent and child.
(cherry picked from commit af9f6de)

Co-authored-by: Sam Gross <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 10, 2024
…-121556)

On heavily loaded machines, the subprocess may finish its sleep before
the parent process manages to synchronize with it via a failed lock.

This leads to errors like:

  Exception: failed to sync child in 300.3 sec

Use pipes instead to mutually synchronize between parent and child.
(cherry picked from commit af9f6de)

Co-authored-by: Sam Gross <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Jul 10, 2024

GH-121585 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jul 10, 2024
@bedevere-app
Copy link

bedevere-app bot commented Jul 10, 2024

GH-121586 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Jul 10, 2024
colesbury added a commit that referenced this pull request Jul 10, 2024
…) (#121586)

On heavily loaded machines, the subprocess may finish its sleep before
the parent process manages to synchronize with it via a failed lock.

This leads to errors like:

  Exception: failed to sync child in 300.3 sec

Use pipes instead to mutually synchronize between parent and child.
(cherry picked from commit af9f6de)

Co-authored-by: Sam Gross <[email protected]>
colesbury added a commit that referenced this pull request Jul 10, 2024
…) (#121585)

On heavily loaded machines, the subprocess may finish its sleep before
the parent process manages to synchronize with it via a failed lock.

This leads to errors like:

  Exception: failed to sync child in 300.3 sec

Use pipes instead to mutually synchronize between parent and child.
(cherry picked from commit af9f6de)

Co-authored-by: Sam Gross <[email protected]>
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
…21556)

On heavily loaded machines, the subprocess may finish its sleep before
the parent process manages to synchronize with it via a failed lock.

This leads to errors like:

  Exception: failed to sync child in 300.3 sec

Use pipes instead to mutually synchronize between parent and child.
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
…21556)

On heavily loaded machines, the subprocess may finish its sleep before
the parent process manages to synchronize with it via a failed lock.

This leads to errors like:

  Exception: failed to sync child in 300.3 sec

Use pipes instead to mutually synchronize between parent and child.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants