Skip to content

use _exit in forked multiproc test workers (#526) - #526

Merged
meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
d4l3k:export-D122596608
Oct 1, 2026
Merged

meta-codesync[bot] merged 1 commit into
pytorch:mainfrom
d4l3k:export-D122596608

Conversation

@d4l3k

@d4l3k d4l3k commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Summary:

MultiProcTest children call exit() after fork, which runs static/folly singleton destructors inherited from the parent. In fbcode, ODS InstrumentReader's FunctionScheduler then joins a thread that only existed in the parent, and ASan aborts with "Joining already joined thread", turning the worker's exit code into 1. This breaks tests that check a specific exit status, e.g. TcpLazyPeerExitBeforeFirstIo in #521 (D116972502). Use _exit() so children skip parent-owned teardown.


Differential Revision: D122596608

@meta-cla meta-cla Bot added the CLA Signed label Sep 30, 2026
@meta-codesync

meta-codesync Bot commented Sep 30, 2026

Copy link
Copy Markdown

@d4l3k has exported this pull request. If you are a Meta employee, you can view the originating Diff in D122596608.

d4l3k added a commit to d4l3k/gloo that referenced this pull request Sep 30, 2026
Summary:

MultiProcTest children call exit() after fork, which runs static/folly singleton destructors inherited from the parent. In fbcode, ODS InstrumentReader's FunctionScheduler then joins a thread that only existed in the parent, and ASan aborts with "Joining already joined thread", turning the worker's exit code into 1. This breaks tests that check a specific exit status, e.g. TcpLazyPeerExitBeforeFirstIo in pytorch#521 (D116972502). Use _exit() so children skip parent-owned teardown.

___

Differential Revision: D122596608
@meta-codesync meta-codesync Bot changed the title use _exit in forked multiproc test workers use _exit in forked multiproc test workers (#526) Sep 30, 2026
Summary:
Pull Request resolved: pytorch#526

MultiProcTest children call exit() after fork, which runs static/folly singleton destructors inherited from the parent. In fbcode, ODS InstrumentReader's FunctionScheduler then joins a thread that only existed in the parent, and ASan aborts with "Joining already joined thread", turning the worker's exit code into 1. This breaks tests that check a specific exit status, e.g. TcpLazyPeerExitBeforeFirstIo in pytorch#521 (D116972502). Use _exit() so children skip parent-owned teardown.

___

Differential Revision: D122596608
@meta-codesync
meta-codesync Bot merged commit 8d8f864 into pytorch:main Oct 1, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants