Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Parallel-ForkManager CPAN distribution.

Report information
The Basics
Id: 107634
Status: resolved
Priority: 0/
Queue: Parallel-ForkManager

People
Owner: Nobody in particular
Requestors: jt [...] plainblack.com
SREZIC [...] cpan.org
Cc:
AdminCc:

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



Subject: 1.15 runs at 100% CPU
Date: Thu, 8 Oct 2015 13:03:50 -0500
To: bug-Parallel-ForkManager [...] rt.cpan.org
From: JT Smith <jt [...] plainblack.com>
Running on the latest CentOS Linux and Perl 5.16 the program I’ve linked below works perfectly on version 1.0.8 of Parallel::ForkManager, but on 1.15 it runs at 100% CPU. I haven’t tried the versions in-between. https://github.com/plainblack/Wing/blob/master/bin/wingman.pl
Subject: Re: [rt.cpan.org #107634] 1.15 runs at 100% CPU
Date: Thu, 08 Oct 2015 14:40:31 -0400
To: bug-Parallel-ForkManager [...] rt.cpan.org
From: Yanick Champoux <yanick [...] babyl.dyndns.org>
On 2015-10-08 02:04 PM, jt@plainblack.com via RT wrote: Show quoted text
> Thu Oct 08 14:04:08 2015: Request 107634 was acted upon. > Transaction: Ticket created by jt@plainblack.com > Queue: Parallel-ForkManager > Subject: 1.15 runs at 100% CPU > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: jt@plainblack.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=107634 > > > > Running on the latest CentOS Linux and Perl 5.16 the program I’ve linked below works perfectly on version 1.0.8 of Parallel::ForkManager, but on 1.15 it runs at 100% CPU. I haven’t tried the versions in-between.
You might want to tweak your `$pm->set_waitpid_blocking_sleep(0);` See https://metacpan.org/pod/Parallel::ForkManager#BLOCKING-CALLS for more details. Joy, `/anick
On 2015-10-08 14:40:48, yanick@babyl.dyndns.org wrote: Show quoted text
> On 2015-10-08 02:04 PM, jt@plainblack.com via RT wrote:
> > Thu Oct 08 14:04:08 2015: Request 107634 was acted upon. > > Transaction: Ticket created by jt@plainblack.com > > Queue: Parallel-ForkManager > > Subject: 1.15 runs at 100% CPU > > Broken in: (no value) > > Severity: (no value) > > Owner: Nobody > > Requestors: jt@plainblack.com > > Status: new > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=107634 > > > > > > > Running on the latest CentOS Linux and Perl 5.16 the program I’ve > > linked below works perfectly on version 1.0.8 of > > Parallel::ForkManager, but on 1.15 it runs at 100% CPU. I haven’t > > tried the versions in-between.
> > You might want to tweak your `$pm->set_waitpid_blocking_sleep(0);` > > See https://metacpan.org/pod/Parallel::ForkManager#BLOCKING-CALLS for > more details.
I'm not sure. Either it's set to 0, then it should block and don't consume CPU, or it is the default, that is 1 (second), and consume very little CPU. Only if somebody sets the sleep value to a very small number (maybe 0.001 or less) then there should be some effect on the CPU usage visible. Actually I can reproduce the 100% with the oneliner below with 1.15. Problem does not occur with 1.13: perl -MParallel::ForkManager -e '$pm=Parallel::ForkManager->new(4);while(1) { $pm->start and next; warn "do something $$"; sleep 1; $pm->finish } $pm->wait_all_children'
On 2015-10-08 15:20:11, SREZIC wrote: Show quoted text
> On 2015-10-08 14:40:48, yanick@babyl.dyndns.org wrote:
> > On 2015-10-08 02:04 PM, jt@plainblack.com via RT wrote:
> > > Thu Oct 08 14:04:08 2015: Request 107634 was acted upon. > > > Transaction: Ticket created by jt@plainblack.com > > > Queue: Parallel-ForkManager > > > Subject: 1.15 runs at 100% CPU > > > Broken in: (no value) > > > Severity: (no value) > > > Owner: Nobody > > > Requestors: jt@plainblack.com > > > Status: new > > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=107634 > > > > > > > > > > Running on the latest CentOS Linux and Perl 5.16 the program I’ve > > > linked below works perfectly on version 1.0.8 of > > > Parallel::ForkManager, but on 1.15 it runs at 100% CPU. I haven’t > > > tried the versions in-between.
> > > > You might want to tweak your `$pm->set_waitpid_blocking_sleep(0);` > > > > See https://metacpan.org/pod/Parallel::ForkManager#BLOCKING-CALLS for > > more details.
> > I'm not sure. Either it's set to 0, then it should block and don't > consume CPU, or it is the default, that is 1 (second), and consume > very little CPU. Only if somebody sets the sleep value to a very small > number (maybe 0.001 or less) then there should be some effect on the > CPU usage visible. > > Actually I can reproduce the 100% with the oneliner below with 1.15. > Problem does not occur with 1.13: > > perl -MParallel::ForkManager -e '$pm=Parallel::ForkManager-
> >new(4);while(1) { $pm->start and next; warn "do something $$"; sleep
> 1; $pm->finish } $pm->wait_all_children'
Manual bisecting shows that the problem was introduced in commit 36578291403767a0afd5c2a598daf961a39a632c
Subject: Re: [rt.cpan.org #107634] 1.15 runs at 100% CPU
Date: Thu, 08 Oct 2015 16:45:00 -0400
To: bug-Parallel-ForkManager [...] rt.cpan.org
From: Yanick Champoux <yanick [...] babyl.dyndns.org>
I think I found the issue. Patch in master, I'll send out a trial version later on tonight. `/.
On 2015-10-08 16:45:19, yanick@babyl.dyndns.org wrote: Show quoted text
> I think I found the issue. Patch in master, I'll send out a trial > version later on tonight. > > `/.
I just tried 9e4417b14b2e2f6d2344df72a9f6fe4d261d83ac and it looks much better wrt CPU usage.
Subject: Re: [rt.cpan.org #107634] 1.15 runs at 100% CPU
Date: Thu, 08 Oct 2015 19:36:42 -0400
To: bug-Parallel-ForkManager [...] rt.cpan.org
From: Yanick Champoux <yanick [...] babyl.dyndns.org>
On 2015-10-08 04:48 PM, Slaven_Rezic via RT wrote: Show quoted text
> Queue: Parallel-ForkManager > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=107634 > > > On 2015-10-08 16:45:19, yanick@babyl.dyndns.org wrote:
>> I think I found the issue. Patch in master, I'll send out a trial >> version later on tonight. >> >> `/.
> > I just tried 9e4417b14b2e2f6d2344df72a9f6fe4d261d83ac and it looks much better wrt CPU usage. >
Pushed to CPAN. Thanks for the investigation! Joy, `/anick
On 2015-10-08 19:37:00, yanick@babyl.dyndns.org wrote: Show quoted text
> On 2015-10-08 04:48 PM, Slaven_Rezic via RT wrote:
> > Queue: Parallel-ForkManager > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=107634 > > > > > On 2015-10-08 16:45:19, yanick@babyl.dyndns.org wrote:
> >> I think I found the issue. Patch in master, I'll send out a trial > >> version later on tonight. > >> > >> `/.
> > > > I just tried 9e4417b14b2e2f6d2344df72a9f6fe4d261d83ac and it looks > > much better wrt CPU usage. > >
> > Pushed to CPAN. Thanks for the investigation!
Thanks!