Skip to content

Ensure parallel workers are cleaned up after failures - #21949

Open
GruffElixir wants to merge 2 commits into
python:masterfrom
GruffElixir:fix/21905-worker-shutdown
Open

Ensure parallel workers are cleaned up after failures#21949
GruffElixir wants to merge 2 commits into
python:masterfrom
GruffElixir:fix/21905-worker-shutdown

Conversation

@GruffElixir

Copy link
Copy Markdown

Fixes #21905.

Parallel output-json checks can raise a compile error while a build worker is still processing. Worker cleanup currently waits once and leaves a slow worker alive, which can surface as ResourceWarning and flaky failures on high-core systems. If the shutdown grace period expires, terminate the worker and fall back to killing it if needed.

Added a regression test for the timeout cleanup path.

Validation:

  • python -m pytest -o addopts='' -q mypy/test/testbuild.py mypy/test/testoutput.py
  • python runtests.py testbuild.py
  • python -m ruff check mypy/test/testbuild.py
  • git diff --check

Copilot AI lite review requested due to automatic review settings September 6, 2026 20:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tests testoutput.py::OutputJSONsuite can be flaky on high-core-count systems

2 participants