develooper Front page | perl.perl6.compiler | Postings from February 2018

[perl #129882] [TESTNEEDED] [CONC] [IO] Proc with `.in.close` and`.out.slurp-rest` in different threads, hangs

From:
Aleks-Daniel Jakimenko-Aleksejev via RT
Date:
February 2, 2018 19:32
Subject:
[perl #129882] [TESTNEEDED] [CONC] [IO] Proc with `.in.close` and`.out.slurp-rest` in different threads, hangs
Message ID:
rt-4.0.24-12230-1517599946-615.129882-80-0@perl.org
Test in
https://github.com/perl6/roast/commit/195227f779f7441de1678e12941550271da799b2

On 2017-07-09 19:40:57, alex.jakimenko@gmail.com wrote:
> That's pretty good. But issues are not closed without tests, unless
> there's a
> good reason not to add a test. No reason was mentioned, therefore
> reopening
> this with “testneeded” tag.
>
> On 2017-07-09 15:49:46, jan-olof.hendig@bredband.net wrote:
> > On Wed, 19 Oct 2016 05:57:04 -0700, jnthn@jnthn.net wrote:
> > > On Fri Oct 14 16:40:27 2016, smls75@gmail.com wrote:
> > > > The following code attempts to pipe a large Blob (larger than a
> > > > pipe's
> > > > buffer size) through an external command.
> > > > However, it hangs on the `.in.close` line and never finishes:
> > > >
> > > > my $proc = run «cat -», :in, :out, :bin;
> > > > my $input = ("a" x 1000000).encode;
> > > > my $promise = start {
> > > > $proc.in.write: $input;
> > > > $proc.in.close;
> > > > }
> > > > say $proc.out.slurp-rest(:close, :bin).bytes;
> > > > await $promise;
> > > >
> > > For now, if using threads, stick with Proc::Async (in the future,
> > > we'll probably re-implement Proc/run etc. in terms of Proc::Async).
> > >
> > > /jnthn
> >
> > jnthn recently made the above mentioned re-implementation so the code
> > shown in the report now works.
> >
> > Closing issue




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About