Subject: | Pipelining stalls if ->done propagates an error from the caller |
If the code invoked by the ->done response Future dies and an error propagates, it stalls the pipeline causing all further requests to sit pending forever.
$ cat pipeline-break-fail.pl
#!/usr/bin/perl
use strict;
use warnings;
use IO::Async::Loop;
use Net::Async::HTTP;
IO::Async::Loop->new->add( my $http = Net::Async::HTTP->new );
my @f = map { $http->GET( "http://www.google.com/" )
->on_done( sub { die "STALL" } )
->else_done() } 1 .. 3;
eval { $f[0]->get } or warn "f[0] failed: $@";
eval { $f[1]->get } or warn "f[1] failed: $@";
eval { $f[2]->get } or warn "f[2] failed: $@";
$ perl pipeline-break-fail.pl
f[0] failed: STALL at pipeline-break-fail.pl line 12.
^C
--
Paul Evans