Skip Menu |

This queue is for tickets about the IO-Event CPAN distribution.

Report information
The Basics
Id: 92200
Status: open
Priority: 0/
Queue: IO-Event

People
Owner: Nobody in particular
Requestors: dam [...] cpan.org
Cc: gregoa [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.813
Fixed in: (no value)



Subject: forks2.t fails under heavy load
First reported in Debian, while rebuilding all packages to scan for failures. (http://bugs.debian.org/730908). The symptoms are that under heavy load, forks2.t test sometimes fails. Here's the output with $debug enabled in t/forked.tt: ------------===========------------- # test paragraph mode, getlines, $/ set funny # ACCEPTED CONNECTION ok 110 ok 111 # got 'go\n' # SENDING 'this is ' # SENDING 'a test\n' # SIGPIPE recevied in 6846 # Looks like you planned 115 tests but ran 111. print 6846: Broken pipe Compilation failed in require at t/forked2.t line 5. ------------===========------------- 6846 is the child PID. The original failure report (linked in the first message from the link above) ends with ------------===========------------- # Looks like you planned 115 tests but ran 111. print 26175: Connection reset by peer Compilation failed in require at t/forked2.t line 5. ------------===========-------------
From: ppisar [...] redhat.com
Dne Čt 16.led.2014 07:07:44, DAM napsal(a): Show quoted text
> First reported in Debian, while rebuilding all packages to scan for > failures. (http://bugs.debian.org/730908). > > The symptoms are that under heavy load, forks2.t test sometimes fails. > Here's the output with $debug enabled in t/forked.tt: > > ------------===========------------- > # test paragraph mode, getlines, $/ set funny > # ACCEPTED CONNECTION > ok 110 > ok 111 > # got 'go\n' > # SENDING 'this is ' > # SENDING 'a test\n' > # SIGPIPE recevied in 6846 > # Looks like you planned 115 tests but ran 111. > print 6846: Broken pipe > Compilation failed in require at t/forked2.t line 5. > ------------===========------------- > > 6846 is the child PID. > > The original failure report (linked in the first message from the link > above) ends with > ------------===========------------- > # Looks like you planned 115 tests but ran 111. > print 26175: Connection reset by peer > Compilation failed in require at t/forked2.t line 5. > ------------===========-------------
This is perfectly reproducible by adding "sleep 1;" between the "(print $s" and "syncany()" lines.
I added the sleep but forked2.t still passes for me.
On 2014-07-17 20:35:28, MUIR wrote: Show quoted text
> I added the sleep but forked2.t still passes for me.
There are also failures reported at CPAN Testers: http://analysis.cpantesters.org/reports_by_field?SUBMIT_xxx=Submit&distv=IO-Event-0.813&field=fail%3At%2Fforked2.t&field=meta%3Aosname%2Bperl&field=fail%3At%2Fforked2.t A value of zero looks like the same problem as described here. This may happen on all OSes and Perl versions. The value of 30 seems to be another problem and happens only on NetBSD systems.
From: ntyni [...] iki.fi
On Thu Jan 16 07:07:44 2014, DAM wrote: Show quoted text
> First reported in Debian, while rebuilding all packages to scan for > failures. (http://bugs.debian.org/730908). > > The symptoms are that under heavy load, forks2.t test sometimes fails.
I can reproduce this quite reliably. It looks like it happens if the parent gets a new connection event before the eof event from the previous one. This wouldn't matter otherwise, but if it's the last test group starting, ie_connection() decrements the counter to zero first, and ie_eof() thinks it's all done even though a new connection has just been accepted. The attached patch should fix it by making the client synchronize on the eof event from the parent before making a new connection. -- Niko Tyni (Debian Perl Group) ntyni@debian.org
Subject: 0001-Fix-undeterministic-test-failures-in-t-forked2.t.patch
From e11dc91080151bb59d73e72c3c0a3409c1b999ef Mon Sep 17 00:00:00 2001 From: Niko Tyni <ntyni@debian.org> Date: Sat, 12 Dec 2015 11:33:34 +0200 Subject: [PATCH] Fix undeterministic test failures in t/forked2.t The parent process may get both the eof event from an old connection and the connect event from a new connection at the same time, and in an unpredictable order. If the connect event comes first, the handler may decrement the test counter to zero and make the eof handler think the testing is already over. Having the child synchronize on the eof event before making a new connection fixes this race. Bug-Debian: https://bugs.debian.org/730908 Bug: https://rt.cpan.org/Ticket/Display.html?id=92200 --- t/forked.tt | 1 + 1 file changed, 1 insertion(+) diff --git a/t/forked.tt b/t/forked.tt index e56c7fa..0d9ce18 100755 --- a/t/forked.tt +++ b/t/forked.tt @@ -265,6 +265,7 @@ if ($child = fork()) { } print "# CHILD closing\n"; close($s); + syncto("e"); } } else { die "fork: $!"; -- 2.6.2