Skip Menu |

This queue is for tickets about the Forks-Super CPAN distribution.

Report information
The Basics
Id: 55232
Status: resolved
Priority: 0/
Queue: Forks-Super

People
Owner: Nobody in particular
Requestors: BOLDRA [...] boldra.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.22
Fixed in: (no value)



Subject: timedout process are not marked as 'REAPED'
Maybe I'm missing something, but when would the state ever be 'REAPED' if it's not when it has timed out? I keep getting 'COMPLETED', with cygwin and strawberry 5.10. ----------------------------- use Forks::Super; use Test::More tests => 1; my $p = fork( sub => sub { sleep 100 }, timeout => 1 ); sleep 2; is( Forks::Super::state($p), 'REAPED', q{state of reaped process is 'REAPED'}); ----------------------------- I really like what you're trying to do in this module. Nice work!
Subject: Re: [rt.cpan.org #55232] timedout process are not marked as 'REAPED'
Date: Thu, 4 Mar 2010 18:41:41 -0800
To: bug-Forks-Super [...] rt.cpan.org
From: "Marty O'Brien" <mobrule [...] gmail.com>
Hi Paul, A process becomes COMPLETE when it is reaped internally to the Forks::Super module (with CORE::waitpid) but doesn't become REAPED until its pid is returned from a call to Forks::Super::wait or Forks::Super::waitpid . Like the regular wait and waitpid calls, each child process id will only be returned once. I'm glad your enjoying this module. Please feel free to let me know if you have any other questions or comments. -- Marty On Thu, Mar 4, 2010 at 8:37 AM, Paul Boldra via RT < bug-Forks-Super@rt.cpan.org> wrote: Show quoted text
> Thu Mar 04 11:37:39 2010: Request 55232 was acted upon. > Transaction: Ticket created by BOLDRA > Queue: Forks-Super > Subject: timedout process are not marked as 'REAPED' > Broken in: 0.22 > Severity: Normal > Owner: Nobody > Requestors: BOLDRA@boldra.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=55232 > > > > Maybe I'm missing something, but when would the state ever be 'REAPED' > if it's not when it has timed out? I keep getting 'COMPLETED', with > cygwin and strawberry 5.10. > > ----------------------------- > use Forks::Super; > use Test::More tests => 1; > > my $p = fork( sub => sub { sleep 100 }, timeout => 1 ); > sleep 2; > is( Forks::Super::state($p), 'REAPED', q{state of reaped process is > 'REAPED'}); > ----------------------------- > > I really like what you're trying to do in this module. Nice work! >
Works as designed and documented. The state of a Forks::Super::Job object will change to REAPED only after its process id has been returned from a call to Forks::Super::wait or Forks::Super::waitpid .
Hi Marty, I had another look at the documentation and really couldn't find what you've written below. I also find it unintuitive. Maybe by sending a specific exit code back you could set the state even when the process is killed by SIG{ALARM} ? Anyway, I already appreciate the module as it is, and am about to move something built on it into production. I wrapped it in Moose and I'm using Forks::Super::wait too so I'm not hanging on a fix. I also recommended it at my local perlmongers last night. Thanks for the module, and keep writting such neat code! Paul Boldra On Mon Mar 08 13:06:43 2010, MOB wrote: Show quoted text
> Works as designed and documented. The state of a Forks::Super::Job object > will change to REAPED only after its process id has been returned from a > call to Forks::Super::wait or Forks::Super::waitpid . >