Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: linux perl - interrupted system calls not restarted?by jakobi (Pilgrim) |
on Oct 22, 2009 at 13:29 UTC ( [id://802741]=note: print w/replies, xml ) | Need Help?? |
consider $SIG{CHLD} = 'IGNORE', which indeed avoids both ending the loop and zombies. Search for reaper and IGNORE.
As you said you need IO::Socket below: Possibly IO::Socket gets irritated by some %SIG handlers (couldn't find anything on the quick in the source or docs though). 2 possible workarounds I currently see:
Seems a known issue: SOLVED: Re: TCP Client-Server: Server exits though it shouldn't loops forever, and retries accept in case of EINTR. But the loop in the reaper looks like it can stop early; and other syscalls may mess up the detection of EINTR, which seems quite far away from the interrupted syscall. Maybe just retry accept() upto n times in a row if $client is false. Note that's there's a small race of the parent running w/o SIG handler, Please also post your updated code when done, thanx, Peter
In Section
Seekers of Perl Wisdom
|
|