Skip to content

Fix race in forked tests under heavy load (rt#92200) - #7

Merged
plicease merged 1 commit into
mainfrom
graham/rt-92200-forked2-race
Oct 6, 2026
Merged

plicease merged 1 commit into
mainfrom
graham/rt-92200-forked2-race

Conversation

@plicease

@plicease plicease commented Oct 6, 2026

Copy link
Copy Markdown
Member

Fixes the intermittent t/forked2.t failure reported in rt#92200 / Debian #730908.

Cause

Under load, the parent can see the connect event for a new connection before the eof event for the previous one. On the last test group ie_connection empties @tests first, then ie_eof thinks testing is done and exits. The child gets SIGPIPE / connection reset (planned 115 tests but ran 111).

Fix

  • Child waits for the parent's e sync after closing each socket, before opening the next connection (patch by Niko Tyni, attached to the RT ticket).
  • Parent sends e before exit 0 unless @tests, so the child's last syncto("e") doesn't read from a closed pipe (which otherwise emits an uninitialized-value warning).

Testing

  • Reproduced the ticket's failure on macOS by temporarily adding a 0.3s sleep to the parent's heartbeat callback; with the fix, the same stall passes cleanly.
  • prove -l t passes except t/getline3.t, which fails identically on main (unrelated, AnyEvent pure-Perl loop).

🤖 Generated with Claude Code

@plicease
plicease force-pushed the graham/rt-92200-forked2-race branch from bc5f6e1 to f48cd57 Compare October 6, 2026 09:03
The parent may see the connect event for a new connection before the
eof event for the previous one. On the last test group the connect
handler empties @tests first, so the eof handler exits early and the
child dies with SIGPIPE / connection reset.

Have the child wait for the parent's eof sync ("e") before opening the
next connection, and send "e" before exiting on the final connection
so the child does not read from a closed pipe.

Patch by Niko Tyni.

Bug: https://rt.cpan.org/Ticket/Display.html?id=92200
Bug-Debian: https://bugs.debian.org/730908

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@plicease
plicease force-pushed the graham/rt-92200-forked2-race branch from f48cd57 to a9376bf Compare October 6, 2026 09:16
@plicease
plicease merged commit 211e061 into main Oct 6, 2026
21 checks passed
@plicease
plicease deleted the graham/rt-92200-forked2-race branch October 6, 2026 09:18
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.

1 participant