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

test_deadlock sometimes causes deadlock #121719

Open
ziima opened this issue Jul 13, 2024 · 1 comment
Open

test_deadlock sometimes causes deadlock #121719

ziima opened this issue Jul 13, 2024 · 1 comment
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@ziima
Copy link
Contributor

ziima commented Jul 13, 2024

Bug report

Bug description:

Found at EuroPython 24 sprints.

./python -m test -j4

sometimes ends up hanging on

0:24:44 load avg: 0.80 running (1): test.test_concurrent_futures.test_deadlock (24 min 3 sec)
0:25:14 load avg: 0.56 running (1): test.test_concurrent_futures.test_deadlock (24 min 33 sec)
0:25:44 load avg: 0.47 running (1): test.test_concurrent_futures.test_deadlock (25 min 3 sec)
0:26:14 load avg: 0.35 running (1): test.test_concurrent_futures.test_deadlock (25 min 33 sec)
0:26:44 load avg: 0.45 running (1): test.test_concurrent_futures.test_deadlock (26 min 3 sec)
0:27:14 load avg: 0.54 running (1): test.test_concurrent_futures.test_deadlock (26 min 33 sec)

Also occurs on @stinovlas machine (Debian or Ubuntu). More details when I'll be reproduce deadlock again.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

@ziima ziima added the type-bug An unexpected behavior, bug, or error label Jul 13, 2024
@Eclips4 Eclips4 added the tests Tests in the Lib/test dir label Jul 13, 2024
@ziima
Copy link
Contributor Author

ziima commented Jul 13, 2024

Finally, I've managed to reproduce the deadlock by

# This script is in fish shell
for I in $(seq 100)
      echo ===== Attempt $I =====
      timeout 300 ./python -X dev -m test -j4 test_concurrent_futures -v
      if test $status -ne 0
          echo "TEST FAILED!"
          break
      end
end | tee /tmp/out.log

Here's the setup from the test output:

== CPython 3.14.0a0 (heads/main:dc03ce797a, Jul 13 2024, 09:48:51) [GCC 13.3.0]
== Linux-6.8.12-amd64-x86_64-with-glibc2.38 little-endian
== Python build: debug
== cwd: /home/ziima/git/cpython/build/test_python_worker_1032543æ
== CPU count: 4
== encodings: locale=UTF-8 FS=utf-8
== resources: all test resources are disabled, use -u option to unskip tests

Full output here: out.log

From my observations it seems to occur more often if I run tests on the whole test_concurrent_futures (or complete tests) than just test_concurrent_futures.test_deadlock. Tests are running on all 4 cores on my notebook.

@encukou It doesn't seem to me that -X dev provides any useful info in this case. If you have any more suggestions on how to debug it, I'm all ears.

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 type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants