raku-community-modules / URI

Raku realization of URI — Uniform Resource Identifiers handler
Artistic License 2.0
3 stars 14 forks source link

URI constructor hangs in a thread #21

Closed jonathanstowe closed 8 years ago

jonathanstowe commented 8 years ago

On #perl6 just now:

<ollej> I'm having an issue when using the URI module inside a Promise. Unless I've used the URI module before awaiting the result, the program never finishes. Using rakudo 2015.09.
<ollej> I've boiled it down to the following example: await Promise.in(1).then({ say URI.new('http://www.example.com'); });

This seems to be the underlying cause of https://rt.perl.org/Ticket/Display.html?id=126390 - it's likely that there is a deeper underlying problem as it is getting deadlocked on a futex() but this is by way of a placeholder in case anyone has a bright idea to work round it in the meantime :)

LLFourn commented 8 years ago

You can reproduce it more precisely with

perl6 -MIETF::RFC_Grammar -e "await Promise.in(1).then({ say IETF::RFC_Grammar.new('rfc3986'); });"

edit, actually this

 perl6 -MIETF::RFC_Grammar::URI -e "await Promise.in(1).then({ require IETF::RFC_Grammar::URI });" 
ab5tract commented 8 years ago

Does @jdv's patch actually fix this in the end?

jonathanstowe commented 8 years ago

It definitely is "fixed", don't know if it was the patch that did it, the examples above and in the https://rt.perl.org/Ticket/Display.html?id=126390 don't hang any more.

I'd say this was safe to close now.