Skip to content

awaiting a Promise in a different thread sometimes hangs #3503

Closed

Description

@p6rt

Migrated from rt.perl.org#122709 (status was 'resolved')

Searchable as RT122709$

Activity

  1. p6rt commented on Sep 5, 2014

    @p6rt
    Author

    From @lizmat

    (since leont has been so busy with other stuff, I thought to report the problem he found)

    12​:11 * leont suspects he's observing Promise.allof spinlocking or some such. 100% CPU usage, but no input is coming in :-/
    12​:19 lizmat leont​: could you gist that ?
    12​:22 leont Would need to reduce it first, but sure
    13​:14 leont My spinlock seems to have gone away when I await()ed in the same thread that created the Proc​::Async
    13​:16 lizmat leont​: interesting datapoint :-)
    13​:16 wonder what jnthn would want to say about that :-)
    13​:22 leont perl6 -e 'my $waiter = Proc​::Async.new(​:path($*EXECUTABLE), :args(["helper.pl"])).start; await start { await $waiter };'
    13​:23 Let's make that easier​: perl6 -e 'my $waiter = Proc​::Async.new(​:path("echo"), :args(<Hello World>)).start; await start { await $waiter };'
    13​:29 moritz leont++ # golfing
    13​:30 leont​: could you please submit that to rakudobugperl.org?
    13​:30 leont Sure

  2. p6rt commented on Sep 5, 2014

    @p6rt
    Author
  3. p6rt commented on Apr 26, 2016

    @p6rt
    Author

    From @coke

    On Fri Sep 05 14​:44​:06 2014, elizabeth wrote​:

    (since leont has been so busy with other stuff, I thought to report
    the problem he found)

    12​:11 * leont suspects he's observing Promise.allof spinlocking or
    some such. 100% CPU usage, but no input is coming in :-/
    12​:19 lizmat leont​: could you gist that ?
    12​:22 leont Would need to reduce it first, but sure
    13​:14 leont My spinlock seems to have gone away when I await()ed
    in the same thread that created the Proc​::Async…
    13​:16 lizmat leont​: interesting datapoint :-)
    13​:16 wonder what jnthn would want to say about that :-)
    13​:22 leont perl6 -e 'my $waiter =
    Proc​::Async.new(​:path($*EXECUTABLE), :args(["helper.pl"])).start;
    await start { await $waiter };'
    13​:23 Let's make that easier​: perl6 -e 'my $waiter =
    Proc​::Async.new(​:path("echo"), :args(<Hello World>)).start; await
    start { await $waiter };'
    13​:29 moritz leont++ # golfing
    13​:30 leont​: could you please submit that to
    rakudobugperl.org?
    13​:30 leont Sure

    This seems to work with no issue here. Is this ticket closable?

    $ perl6 -e 'my $waiter = Proc​::Async.new(​:path("echo"), :args(<Hello World>)).start; await start { await $waiter };'
    Hello World

    --
    Will "Coke" Coleda

  4. p6rt commented on Apr 26, 2016

    @p6rt
    Author

    The RT System itself - Status changed from 'new' to 'open'

  5. p6rt commented on Apr 27, 2016

    @p6rt
    Author

    From @LLFourn

    Not sure if it's relevant here but last time I checked there is an issues
    with await and Proc​::Async on Mac.

    RT #​125758 for example which looks similar to this.
    On Wed, 27 Apr 2016 at 7​:08 AM, Will Coleda via RT <
    perl6-bugs-followup@​perl.org> wrote​:

    On Fri Sep 05 14​:44​:06 2014, elizabeth wrote​:

    (since leont has been so busy with other stuff, I thought to report
    the problem he found)

    12​:11 * leont suspects he's observing Promise.allof spinlocking or
    some such. 100% CPU usage, but no input is coming in :-/
    12​:19 lizmat leont​: could you gist that ?
    12​:22 leont Would need to reduce it first, but sure
    13​:14 leont My spinlock seems to have gone away when I await()ed
    in the same thread that created the Proc​::Async…
    13​:16 lizmat leont​: interesting datapoint :-)
    13​:16 wonder what jnthn would want to say about that :-)
    13​:22 leont perl6 -e 'my $waiter =
    Proc​::Async.new(​:path($*EXECUTABLE), :args(["helper.pl"])).start;
    await start { await $waiter };'
    13​:23 Let's make that easier​: perl6 -e 'my $waiter =
    Proc​::Async.new(​:path("echo"), :args(<Hello World>)).start; await
    start { await $waiter };'
    13​:29 moritz leont++ # golfing
    13​:30 leont​: could you please submit that to
    rakudobugperl.org?
    13​:30 leont Sure

    This seems to work with no issue here. Is this ticket closable?

    $ perl6 -e 'my $waiter = Proc​::Async.new(​:path("echo"), :args(<Hello
    World>)).start; await start { await $waiter };'
    Hello World

    --
    Will "Coke" Coleda

  6. p6rt commented on Apr 27, 2016

    @p6rt
    Author

    From @LLFourn

    Now I'm at home I tried it on my Mac, I can confirm that​:

    perl6 -e 'my $waiter = Proc​::Async.new(​:path<echo>, :args<Hello
    World>).start; await start { await $waiter }'

    prints Hello World and then hangs forever.

    On Wed, Apr 27, 2016 at 2​:58 PM Lloyd Fournier <lloyd.fourn@​gmail.com>
    wrote​:

    Not sure if it's relevant here but last time I checked there is an issues
    with await and Proc​::Async on Mac.

    RT #​125758 for example which looks similar to this.
    On Wed, 27 Apr 2016 at 7​:08 AM, Will Coleda via RT <
    perl6-bugs-followup@​perl.org> wrote​:

    On Fri Sep 05 14​:44​:06 2014, elizabeth wrote​:

    (since leont has been so busy with other stuff, I thought to report
    the problem he found)

    12​:11 * leont suspects he's observing Promise.allof spinlocking or
    some such. 100% CPU usage, but no input is coming in :-/
    12​:19 lizmat leont​: could you gist that ?
    12​:22 leont Would need to reduce it first, but sure
    13​:14 leont My spinlock seems to have gone away when I await()ed
    in the same thread that created the Proc​::Async…
    13​:16 lizmat leont​: interesting datapoint :-)
    13​:16 wonder what jnthn would want to say about that :-)
    13​:22 leont perl6 -e 'my $waiter =
    Proc​::Async.new(​:path($*EXECUTABLE), :args(["helper.pl"])).start;
    await start { await $waiter };'
    13​:23 Let's make that easier​: perl6 -e 'my $waiter =
    Proc​::Async.new(​:path("echo"), :args(<Hello World>)).start; await
    start { await $waiter };'
    13​:29 moritz leont++ # golfing
    13​:30 leont​: could you please submit that to
    rakudobugperl.org?
    13​:30 leont Sure

    This seems to work with no issue here. Is this ticket closable?

    $ perl6 -e 'my $waiter = Proc​::Async.new(​:path("echo"), :args(<Hello
    World>)).start; await start { await $waiter };'
    Hello World

    --
    Will "Coke" Coleda

  7. p6rt commented on May 2, 2016

    @p6rt
    Author

    From @coke

    On Wed Apr 27 03​:02​:14 2016, lloyd.fourn@​gmail.com wrote​:

    Now I'm at home I tried it on my Mac, I can confirm that​:

    perl6 -e 'my $waiter = Proc​::Async.new(​:path<echo>, :args<Hello
    World>).start; await start { await $waiter }'

    prints Hello World and then hangs forever.

    On Wed, Apr 27, 2016 at 2​:58 PM Lloyd Fournier <lloyd.fourn@​gmail.com>
    wrote​:

    Not sure if it's relevant here but last time I checked there is an issues
    with await and Proc​::Async on Mac.

    RT #​125758 for example which looks similar to this.
    On Wed, 27 Apr 2016 at 7​:08 AM, Will Coleda via RT <
    perl6-bugs-followup@​perl.org> wrote​:

    On Fri Sep 05 14​:44​:06 2014, elizabeth wrote​:

    (since leont has been so busy with other stuff, I thought to report
    the problem he found)

    12​:11 * leont suspects he's observing Promise.allof spinlocking or
    some such. 100% CPU usage, but no input is coming in :-/
    12​:19 lizmat leont​: could you gist that ?
    12​:22 leont Would need to reduce it first, but sure
    13​:14 leont My spinlock seems to have gone away when I await()ed
    in the same thread that created the Proc​::Async…
    13​:16 lizmat leont​: interesting datapoint :-)
    13​:16 wonder what jnthn would want to say about that :-)
    13​:22 leont perl6 -e 'my $waiter =
    Proc​::Async.new(​:path($*EXECUTABLE), :args(["helper.pl"])).start;
    await start { await $waiter };'
    13​:23 Let's make that easier​: perl6 -e 'my $waiter =
    Proc​::Async.new(​:path("echo"), :args(<Hello World>)).start; await
    start { await $waiter };'
    13​:29 moritz leont++ # golfing
    13​:30 leont​: could you please submit that to
    rakudobugperl.org?
    13​:30 leont Sure

    This seems to work with no issue here. Is this ticket closable?

    $ perl6 -e 'my $waiter = Proc​::Async.new(​:path("echo"), :args(<Hello
    World>)).start; await start { await $waiter };'
    Hello World

    --
    Will "Coke" Coleda

    Can you include the output of sw_vers and perl6 --version ?

    --
    Will "Coke" Coleda

  8. p6rt commented on May 2, 2016

    @p6rt
    Author

    From @smls

    For me, the command sometimes hangs and sometimes doesn't.

    This is on up-do-date Rakudo​:

      ➜ uname -srm
      Linux 4.5.2-1-ARCH x86_64
     
      ➜ perl6 --version
      This is Rakudo version 2016.04-74-ga16f0a4 built on MoarVM version 2016.04
      implementing Perl 6.c.

  9. p6rt commented on May 6, 2016

    @p6rt
    Author

    From @LLFourn

    It works now!

    whoever fixed it++. Close this! (and #​125758).

    On Mon, May 2, 2016 at 11​:34 PM Will Coleda via RT <
    perl6-bugs-followup@​perl.org> wrote​:

    On Wed Apr 27 03​:02​:14 2016, lloyd.fourn@​gmail.com wrote​:

    Now I'm at home I tried it on my Mac, I can confirm that​:

    perl6 -e 'my $waiter = Proc​::Async.new(​:path<echo>, :args<Hello
    World>).start; await start { await $waiter }'

    prints Hello World and then hangs forever.

    On Wed, Apr 27, 2016 at 2​:58 PM Lloyd Fournier <lloyd.fourn@​gmail.com>
    wrote​:

    Not sure if it's relevant here but last time I checked there is an
    issues
    with await and Proc​::Async on Mac.

    RT #​125758 for example which looks similar to this.
    On Wed, 27 Apr 2016 at 7​:08 AM, Will Coleda via RT <
    perl6-bugs-followup@​perl.org> wrote​:

    On Fri Sep 05 14​:44​:06 2014, elizabeth wrote​:

    (since leont has been so busy with other stuff, I thought to report
    the problem he found)

    12​:11 * leont suspects he's observing Promise.allof spinlocking or
    some such. 100% CPU usage, but no input is coming in :-/
    12​:19 lizmat leont​: could you gist that ?
    12​:22 leont Would need to reduce it first, but sure
    13​:14 leont My spinlock seems to have gone away when I await()ed
    in the same thread that created the Proc​::Async…
    13​:16 lizmat leont​: interesting datapoint :-)
    13​:16 wonder what jnthn would want to say about that :-)
    13​:22 leont perl6 -e 'my $waiter =
    Proc​::Async.new(​:path($*EXECUTABLE), :args(["helper.pl"])).start;
    await start { await $waiter };'
    13​:23 Let's make that easier​: perl6 -e 'my $waiter =
    Proc​::Async.new(​:path("echo"), :args(<Hello World>)).start; await
    start { await $waiter };'
    13​:29 moritz leont++ # golfing
    13​:30 leont​: could you please submit that to
    rakudobugperl.org?
    13​:30 leont Sure

    This seems to work with no issue here. Is this ticket closable?

    $ perl6 -e 'my $waiter = Proc​::Async.new(​:path("echo"), :args(<Hello
    World>)).start; await start { await $waiter };'
    Hello World

    --
    Will "Coke" Coleda

    Can you include the output of sw_vers and perl6 --version ?

    --
    Will "Coke" Coleda

  10. p6rt commented on May 6, 2016

    @p6rt
    Author

    From @lizmat

    FWIW, I think it was 1ee27e660a8dce3ae

    On 06 May 2016, at 11​:55, Lloyd Fournier <lloyd.fourn@​gmail.com> wrote​:

    It works now!

    whoever fixed it++. Close this! (and #​125758).

    On Mon, May 2, 2016 at 11​:34 PM Will Coleda via RT <perl6-bugs-followup@​perl.org> wrote​:
    On Wed Apr 27 03​:02​:14 2016, lloyd.fourn@​gmail.com wrote​:

    Now I'm at home I tried it on my Mac, I can confirm that​:

    perl6 -e 'my $waiter = Proc​::Async.new(​:path<echo>, :args<Hello
    World>).start; await start { await $waiter }'

    prints Hello World and then hangs forever.

    On Wed, Apr 27, 2016 at 2​:58 PM Lloyd Fournier <lloyd.fourn@​gmail.com>
    wrote​:

    Not sure if it's relevant here but last time I checked there is an issues
    with await and Proc​::Async on Mac.

    RT #​125758 for example which looks similar to this.
    On Wed, 27 Apr 2016 at 7​:08 AM, Will Coleda via RT <
    perl6-bugs-followup@​perl.org> wrote​:

    On Fri Sep 05 14​:44​:06 2014, elizabeth wrote​:

    (since leont has been so busy with other stuff, I thought to report
    the problem he found)

    12​:11 * leont suspects he's observing Promise.allof spinlocking or
    some such. 100% CPU usage, but no input is coming in :-/
    12​:19 lizmat leont​: could you gist that ?
    12​:22 leont Would need to reduce it first, but sure
    13​:14 leont My spinlock seems to have gone away when I await()ed
    in the same thread that created the Proc​::Async…
    13​:16 lizmat leont​: interesting datapoint :-)
    13​:16 wonder what jnthn would want to say about that :-)
    13​:22 leont perl6 -e 'my $waiter =
    Proc​::Async.new(​:path($*EXECUTABLE), :args(["helper.pl"])).start;
    await start { await $waiter };'
    13​:23 Let's make that easier​: perl6 -e 'my $waiter =
    Proc​::Async.new(​:path("echo"), :args(<Hello World>)).start; await
    start { await $waiter };'
    13​:29 moritz leont++ # golfing
    13​:30 leont​: could you please submit that to
    rakudobugperl.org?
    13​:30 leont Sure

    This seems to work with no issue here. Is this ticket closable?

    $ perl6 -e 'my $waiter = Proc​::Async.new(​:path("echo"), :args(<Hello
    World>)).start; await start { await $waiter };'
    Hello World

    --
    Will "Coke" Coleda

    Can you include the output of sw_vers and perl6 --version ?

    --
    Will "Coke" Coleda

  11. p6rt commented on May 6, 2016

    @p6rt
    Author

    From @smls

    No, this one-liner...

      perl6 -e 'my $waiter = Proc​::Async.new(​:path<echo>, :args<Hello World>).start; await start { await $waiter }'

    ...still occasionally hangs for me on the latest Rakudo nom​:

      This is Rakudo version 2016.04-117-g7db7b46 built on MoarVM version 2016.04
      implementing Perl 6.c.

    But it does appear to happen more seldomly now.
    Make sure you run it many times before concluding that it works for you.

  12. p6rt commented on Aug 3, 2016

    @p6rt
    Author

    From @jnthn

    On Fri May 06 06​:54​:52 2016, smls75@​gmail.com wrote​:

    No, this one-liner...

    perl6 -e 'my $waiter = Proc​::Async.new(​:path<echo>, :args<Hello
    World>).start; await start { await $waiter }'

    ...still occasionally hangs for me on the latest Rakudo nom​:

    This is Rakudo version 2016.04-117-g7db7b46 built on MoarVM version
    2016.04
    implementing Perl 6.c.

    But it does appear to happen more seldomly now.
    Make sure you run it many times before concluding that it works for
    you.

    I can still reproduce it too; seems that occasionally the scheduler starts too few threads (in fact, only one, and that is tied up with the await, and so nothing processes the incoming message saying the process ended).

  13. p6rt commented on Oct 4, 2017

    @p6rt
    Author

    From @jnthn

    On Wed, 03 Aug 2016 12​:23​:32 -0700, jnthn@​jnthn.net wrote​:

    I can still reproduce it too; seems that occasionally the scheduler
    starts too few threads (in fact, only one, and that is tied up with
    the await, and so nothing processes the incoming message saying the
    process ended).

    The new scheduler merged a couple weeks back addresses this; added a test in S17-procasync/stress.t.

  14. p6rt commented on Oct 4, 2017

    @p6rt
    Author

    @jnthn - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions