You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5e815cc
Browse filesBrowse the repository at this point in the historyBrowse files
Adds a regression test in `Lib/test/test_os/test_posix.py` to verify that registering callbacks multiple times via `os.register_at_fork()` correctly preserves both old and newly registered handlers across successive forks.
6
+
7
+
Specifically, it verifies:
8
+
- `before` handlers execute in LIFO (reverse) order.
9
+
- `after_in_parent` handlers execute in FIFO order.
10
+
- `after_in_child` handlers execute in FIFO order.
11
+
- Handlers registered after an earlier fork accumulate and run alongside previous generations in subsequent forks.
12
+
13
+
### Note on Previous Work
14
+
This issue was originally reported by @itsankitkp with an initial implementation in #103759.
15
+
16
+
This PR supersedes #103759 by addressing reliability issues in the earlier attempt:
17
+
- Eliminates multi-process race conditions on a shared pipe by validating events per-process in memory.
18
+
- Eliminates pipe token-starvation deadlocks on child exit.
19
+
- Uses `test.support.wait_process` to reap child processes cleanly and verify exit status.
20
+
21
+
Credit is attributed to the original author via the commit trailer (`Co-authored-by`).
22
+
23
+
### Checklist
24
+
- [x] Tested locally with `./python -m test -v test_os.test_posix`
25
+
- [x] All required CI checks passed cleanly
26
+
- [x] No NEWS entry required (test-only change as per Devguide)
0 commit comments