GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test_deadlock & test_threads sometimes deadlock on Windows refleaks buildbot · Issue #114440 · python/cpython

test_deadlock & test_threads sometimes deadlock on Windows refleaks buildbot #114440

New issue
Copy link
New issue
Copy link
Closed
Closed
test_deadlock & test_threads sometimes deadlock on Windows refleaks buildbot#114440
Copy link
Assignees
encukou
Labels
3.12only security fixesonly security fixesOS-windowstestsTests in the Lib/test dirTests in the Lib/test dir

Description

@encukou
encukou
opened on Jan 22, 2024
Issue body actions

The “AMD64 Windows11 Refleaks 3.12” sometimes deadlocks with:

3:58:18 load avg: 0.07 running (1): test.test_concurrent_futures.test_deadlock (2 hour 34 min)
3:58:48 load avg: 0.05 running (1): test.test_concurrent_futures.test_deadlock (2 hour 35 min)
3:59:18 load avg: 0.03 running (1): test.test_concurrent_futures.test_deadlock (2 hour 35 min)
3:59:48 load avg: 0.02 running (1): test.test_concurrent_futures.test_deadlock (2 hour 36 min)
command timed out: 14400 seconds elapsed running [b'Tools\\buildbot\\test.bat', b'-p', b'x64', b'-j2', b'-R', b'3:3', b'-u-cpu', b'-j2', b'--timeout', b'12000'], attempting to kill
4:00:18 load avg: 0.03 running (1): test.test_concurrent_futures.test_deadlock (2 hour 36 min)
program finished with exit code 1
elapsedTime=14430.167703

On some builds, a different test fails:

3:58:59 load avg: 0.03 running (1): test.test_multiprocessing_spawn.test_threads (1 hour 43 min)
3:59:29 load avg: 0.06 running (1): test.test_multiprocessing_spawn.test_threads (1 hour 44 min)
command timed out: 14400 seconds elapsed running [b'Tools\\buildbot\\test.bat', b'-p', b'x64', b'-j2', b'-R', b'3:3', b'-u-cpu', b'-j2', b'--timeout', b'12000'], attempting to kill
3:59:59 load avg: 0.04 running (1): test.test_multiprocessing_spawn.test_threads (1 hour 44 min)
program finished with exit code 1
elapsedTime=14430.167536

I am able to reproduce locally, by running these two (or this and test_concurrent_futures.test_shutdown) in parallel. The deadlock occurs in test_crash_big_data.

Linked PRs

  • [3.12] gh-114440: Close writer pipe in multiprocessing.Queue, not concurrent.futures #114489

Activity

  1. encukou
    self-assigned this
    on Jan 22, 2024
  2. encukou
    added
    3.12only security fixesonly security fixes
    on Jan 23, 2024
  3. erlend-aasland
    added
    testsTests in the Lib/test dirTests in the Lib/test dir
    OS-windows
    on Jan 23, 2024
  4. encukou
    added a commit that references this issue on Jan 23, 2024

    [3.12] pythongh-114440: Close writer pipe in multiprocessing.Queue, n…

    188228f
  5. encukou commented on Jan 23, 2024

    @encukou
    encukou
    on Jan 23, 2024
    MemberAuthor
    More actions

    In the 3.12 backports for gh-109047, gh-109370, and gh-107219, a backporting/rebasing error snuck in:

    • test_concurrent_futures.test_deadlock: test_crash_big_data() hangs randomly on Windows #107219 adds self.call_queue._writer.close() to _ExecutorManagerThread in concurrent.futures.
    • Unexpected traceback output in test_concurrent_futures and crash #109370 changes this to be only called on Windows.
    • test_concurrent_futures.test_shutdown: test_interpreter_shutdown() fails randomly (race condition) #109047 moves the call to multiprocessing.Queue's _terminate_broken.

    The backports to 3.12 were applied in a different order (and with different bases), leaving the Windows-specific close call in concurrent.futures. Moving it to multiprocessing.Queue fixes test_concurrent_futures.test_deadlock for me.

  6. encukou
    added a commit that references this issue on Jan 24, 2024

    [3.12] gh-114440: Close writer pipe in multiprocessing.Queue, not con…

    c912bc3
  7. encukou commented on Jan 24, 2024

    @encukou
    encukou
    on Jan 24, 2024
    MemberAuthor
    More actions

    Thanks Victor & Serhiy!

    I'll close the issue but continue monitoring buildbots.

  8. encukou
    closed this as completedon Jan 24, 2024
  9. encukou commented on Jan 26, 2024

    @encukou
    encukou
    on Jan 26, 2024
    MemberAuthor
    More actions

    Victor pointed out that this might need a backport to 3.11.
    ( I haven't seen it on the 3.11 buildbots, and didn't try to reproduce there.)

  10. encukou
    reopened this on Jan 26, 2024
  11. encukou commented on Jan 29, 2024

    @encukou
    encukou
    on Jan 29, 2024
    MemberAuthor
    More actions

    I cannot reproduce on 3.11. (I am using a simplified reproducer. But I also haven't seen this fail on a 3.11 buildbot yet.)
    If it comes up in the future, #109047 (356de02) probably needs to be backported before this.

  12. encukou
    closed this as completedon Jan 29, 2024
  13. naveen521kk
    added 5 commits that reference this issue on Feb 19, 2024

    [3.12] pythongh-114440: Close writer pipe in multiprocessing.Queue, n…

    c4877f2

    [3.12] pythongh-114440: Close writer pipe in multiprocessing.Queue, n…

    fd8463b

    [3.12] pythongh-114440: Close writer pipe in multiprocessing.Queue, n…

    df2288a

    [3.12] pythongh-114440: Close writer pipe in multiprocessing.Queue, n…

    df5f451

    [3.12] pythongh-114440: Close writer pipe in multiprocessing.Queue, n…

    69198de
  14. naveen521kk
    added 3 commits that reference this issue on Jul 11, 2024

    [3.12] pythongh-114440: Close writer pipe in multiprocessing.Queue, n…

    6a3e15b

    [3.12] pythongh-114440: Close writer pipe in multiprocessing.Queue, n…

    23a82b7

    [3.12] pythongh-114440: Close writer pipe in multiprocessing.Queue, n…

    701b465
  15. naveen521kk
    added a commit that references this issue on Aug 5, 2024

    [3.12] pythongh-114440: Close writer pipe in multiprocessing.Queue, n…

    2ce1791
  16. naveen521kk
    added a commit that references this issue on Sep 4, 2024

    [3.12] pythongh-114440: Close writer pipe in multiprocessing.Queue, n…

    1ca1659
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @encukou
    encukou

Labels

3.12only security fixesonly security fixesOS-windowstestsTests in the Lib/test dirTests in the Lib/test dir

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.