Skip Menu |

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

Report information
The Basics
Id: 90066
Status: open
Priority: 0/
Queue: IO-Async

People
Owner: Nobody in particular
Requestors: Chris.Wright [...] OntarioSystems.com
Cc:
AdminCc:

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



Subject: IO Async Function Issue
Date: Tue, 5 Nov 2013 11:52:08 -0500
To: "bug-IO-Async [...] rt.cpan.org" <bug-IO-Async [...] rt.cpan.org>
From: Chris Wright <Chris.Wright [...] OntarioSystems.com>
The attached script demonstrates what I am seeing with this library. I have run this test on Centos Perl 5.18.1 with IO::Async 0.60 and Windows 7 x64 Strawberry x64 5.16.3 with IO::Async 0.61. The program calls the Function once and the return from that function calls the function 4 more times in quick succession. One of these calls doesn't happen if the function is declared with Max Workers at 1, 2, or 3. If I set Max Workers to 4, all 4 function calls occur. c:\Temp>perl IOAsyncFunction.pl Test started running on MSWin32 CallWebService called with Web Service 1 and Version 10 Function called for Web Service 1 with version 10 Web Service 1 returned version 10 obtained CallWebService called with Web Service 2 and Version 20 Function called for Web Service 2 with version 20 CallWebService called with Web Service 3 and Version 30 CallWebService called with Web Service 4 and Version 40 CallWebService called with Web Service 5 and Version 50 Web Service 2 returned version 20 obtained Function called for Web Service 4 with version 40 Web Service 4 returned version 40 obtained Function called for Web Service 5 with version 50 Web Service 5 returned version 50 obtained Terminating on signal SIGINT(2) c:\Temp> Attention: This message and all attachments are private and may contain information that is confidential and privileged. If you received this message in error, please notify the sender by reply email and delete the message immediately.

Message body is not shown because sender requested not to inline it.

RT-Send-CC: rho [...] devc.at
On Tue Nov 05 11:50:57 2013, Chris.Wright@OntarioSystems.com wrote: Show quoted text
> The program calls the Function once and the return from that function > calls the function 4 more times in quick succession. One of these > calls doesn't happen if the function is declared with Max Workers at > 1, 2, or 3. If I set Max Workers to 4, all 4 function calls occur.
My problem here might be related. If max_workers is NOT left undefined, but is rather specified, the system hangs in certain constellations (see attached). Output should be worker top-aaa_0 at /tmp/hang.pl line 8. worker top-bbbb_0 at /tmp/hang.pl line 8. worker top-ccccccc_0 at /tmp/hang.pl line 8. worker top-ddddd_0 at /tmp/hang.pl line 8. worker top-eeee_0 at /tmp/hang.pl line 8. worker top-ffff_0 at /tmp/hang.pl line 8. worker top-gggg_0 at /tmp/hang.pl line 8. worker top-bbbb_1 at /tmp/hang.pl line 8. worker top-ccccccc_1 at /tmp/hang.pl line 8. worker top-ddddd_1 at /tmp/hang.pl line 8. worker top-eeee_1 at /tmp/hang.pl line 8. worker top-ffff_1 at /tmp/hang.pl line 8. worker top-gggg_1 at /tmp/hang.pl line 8. worker top-ccccccc_2 at /tmp/hang.pl line 8. worker top-ddddd_2 at /tmp/hang.pl line 8. worker top-eeee_2 at /tmp/hang.pl line 8. worker top-ffff_2 at /tmp/hang.pl line 8. worker top-gggg_2 at /tmp/hang.pl line 8. worker top-ddddd_3 at /tmp/hang.pl line 8. worker top-eeee_3 at /tmp/hang.pl line 8. worker top-ffff_3 at /tmp/hang.pl line 8. worker top-gggg_3 at /tmp/hang.pl line 8. worker top-eeee_4 at /tmp/hang.pl line 8. worker top-ffff_4 at /tmp/hang.pl line 8. worker top-gggg_4 at /tmp/hang.pl line 8. worker top-ffff_5 at /tmp/hang.pl line 8. worker top-gggg_5 at /tmp/hang.pl line 8. worker top-gggg_6 at /tmp/hang.pl line 8. but with max_workers => 5 it is worker top-aaa_0 at /tmp/hang.pl line 8. worker top-bbbb_0 at /tmp/hang.pl line 8. worker top-ccccccc_0 at /tmp/hang.pl line 8. worker top-ddddd_0 at /tmp/hang.pl line 8. worker top-eeee_0 at /tmp/hang.pl line 8. worker top-ffff_0 at /tmp/hang.pl line 8. worker top-gggg_0 at /tmp/hang.pl line 8. worker top-bbbb_1 at /tmp/hang.pl line 8. worker top-ccccccc_1 at /tmp/hang.pl line 8. worker top-ddddd_1 at /tmp/hang.pl line 8. worker top-eeee_1 at /tmp/hang.pl line 8. worker top-ffff_1 at /tmp/hang.pl line 8. cheers, \rho
Subject: hang.pl
use IO::Async::Loop; my $loop = IO::Async::Loop->new; use IO::Async::Function; my $function = IO::Async::Function->new( max_workers => 5, # one less than length of @SCHEDULE is ok, but NOT LESS code => sub { my $tid = "top-".$_[0]; warn "worker $tid"; return 5; }, ); $loop->add( $function ); my @SCHEDULE = ( 'aaa', 'bbbb', 'ccccccc', 'ddddd', 'eeee', 'ffff', 'gggg' ); my $schedule = _mk_future_front (); sub _mk_future_front { my $round = shift || 0; my $front = Future->needs_all( map { $function->call( args => [ $_.'_'.$round ], ) } @SCHEDULE ); $front->on_ready ( sub { shift @SCHEDULE; # $function->restart; $schedule = _mk_future_front ($round+1) if @SCHEDULE; }); return $front; } $loop->run;