Skip Menu |
Report information
Id: 125758
Status: resolved
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: ugexe [at] cpan.org
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: MacOS X
Patch Status: (no value)
VM: (no value)



Subject: OSX `await` not waiting for Planned promise
Download (untitled) / with headers
text/plain 790b
I seem to have hit a strange bug on osx where for: `await $promise; say $promise.perl` shows $promise as planned (its not waiting). If i do: `$promise.result; await $promise; say $promise.perl` it shows the promise as Kept after properly awaiting. I am not able to golf down an example, however this code snippet may clarify: https://gist.github.com/ugexe/ab6ca0453900cc0c746d Inside the .then() in the gist above the `await` works fine. `$p` gets returned ($promise = $p). Then comes the originally mentioned `await $promise; say $promise.perl` which shows Planned. The .then() chain is then being executed (instead of executed during the `await $promise`). If I do `$promise.result; await $promise; say $promise.perl` it shows `Kept` and executes the .then() chain during the `await`
I should mention regarding the gist above: $promise = $.start-processes
Download (untitled) / with headers
text/plain 171b
Attached is a stand alone example of this bug. It (along with example output on Linux and OSX) can also be seen here: https://gist.github.com/ugexe/a3c1efc1c3c6d4f42fdc
Subject: rt125758.pl6
Download rt125758.pl6
application/octet-stream 908b

Message body not shown because it is not plain text.

RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 555b
On Wed Aug 05 11:45:14 2015, ugexe@cpan.org wrote: Show quoted text
> I seem to have hit a strange bug on osx where for: > `await $promise; say $promise.perl` > shows $promise as planned (its not waiting). > > If i do: > `$promise.result; await $promise; say $promise.perl` > it shows the promise as Kept after properly awaiting. >
This was fixed a while back in Rakudo commit 1ee27e660a8. Given there are numerous Promise-using tests in the test suite that would have occasionally failed due to this bug, I think we can consider it sufficiently covered also. /jnthn


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org