Skip to content

Bugfix/68573 multiprocessing wait importerror#68722

Draft
harshang03 wants to merge 6 commits intosaltstack:masterfrom
harshang03:bugfix/68573-multiprocessing-wait-importerror
Draft

Bugfix/68573 multiprocessing wait importerror#68722
harshang03 wants to merge 6 commits intosaltstack:masterfrom
harshang03:bugfix/68573-multiprocessing-wait-importerror

Conversation

@harshang03
Copy link

What does this PR do?

Prevents Salt master/minion shutdown paths from crashing when multiprocessing.Process.join() triggers an ImportError due to partially-initialized stdlib modules (notably multiprocessing.connection.wait) during signal-handling / teardown re-entrancy. Adds a safer child-reaping path that falls back to non-blocking exitcode polling.

What issues does this PR fix or reference?

Fixes #68573

Previous Behavior

During shutdown (SIGTERM) on some systems, the master could log an unhandled exception like:
ImportError: cannot import name 'wait' from partially initialized module 'multiprocessing.connection'
originating from Process.join() while killing children.

New Behavior

Shutdown no longer fails due to this ImportError. Child cleanup is best-effort and robust: kill_children() tolerates join-time ImportErrors and reaps via exitcode polling instead.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

No

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.

[Bug]: ImportError: cannot import name 'wait' from partially initialized module '

1 participant