-
Notifications
You must be signed in to change notification settings - Fork 1
stall/block in async heavy code #6605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
From @jdvBelow is the best golfing I could manage. I ran it like so for while perl6 test.pl6; do :; done The symptom is that sometimes (90%+ on my box and ungolfed) the program [jdv@new-host-2]$ cat test.pl6 my %c = (:0reactor_count); emit $c-conn; %c{$c-conn}<msgs-supplier> = Supplier.new; $c-conn.Supply.lines.tap({ sub start_reactor ($msgs-in) { start { sleep 1; [jdv@new-host-2]$ git bisect good Initial re-implementation of thread pool scheduler Has separate general and timer queues with separate workers, and The new implementation also adds a supervisor, which is where we Finally, a new RAKUDO_SCHEDULER_DEBUG environment variable can be :040000 040000 249e0613cf30b283f4fc3cbb0003474377f6019d |
From @ugexeRAKUDO_SCHEDULER_DEBUG=1 perl6-gdb-m --ll-exception -e 'while 1 { use v6.d.PREVIEW; my %c = (:0reactor_count); my $s = supply { whenever IO::Socket::Async.listen("0.0.0.0", 5000) -> $c-conn { %c{$c-conn}<bar>++; emit $c-conn; %c{$c-conn}<msgs-supplier> = Supplier.new; $c-conn.Supply.lines.tap({ %c{$c-conn}<msgs-supplier>.emit: $_ }); } }; sub start_reactor ($msgs-in) { start { react whenever $msgs-in -> $msg-in { say "before"; say QX("echo foo"); say "after"; %c<reactor_count>++; } } }; start { react whenever $s -> $c-conn { start { start_reactor(%c{$c-conn}<msgs-supplier>.Supply); } } }; sleep 1; my $c = await IO::Socket::Async.connect("0.0.0.0", 5000); await $c.print("foo\n"); sleep 1; }' Eventually prints out (for me): Unhandled exception in code scheduled on thread 4 |
The RT System itself - Status changed from 'new' to 'open' |
From @jnthnOn Fri, 13 Oct 2017 10:13:36 -0700, jdv79 wrote:
So if I follow correctly, the changes in the commit mentioned make an existing problem manifest sooner, rather than introduce the problem? |
From @jdvNo, sorry. I meant that I only tested for a couple minutes at each On 2017.10.16 10:52 am, jnthn@jnthn.net via RT wrote:
|
From @AlexDanielOK, first of all, thank you for the report. The issue is indeed there, and in my opinion it's a significant problem. Secondly, ♥👍 for trying to bisect it manually. Nowadays I only do it with a bot unless I have to trisect rakudo+nqp+moar. However, the result of bisection is wrong (as far as I can see), and my guess is that on some steps you used “git bisect bad” when you should have used “git bisect skip” (when bisecting automatically you should use exit code 125 in these situations). It just happens that on some commits you can't really build rakudo (e.g. some work was split into several commits so some of the intermediate versions are unbuildable). We should try to avoid these situations, but it happens. On these commits you don't really know if the bug is there or not because there is simply no way to test. Similar bug (but not the same one) was bisected with a bot, and you can take a look at the result: https://gist.github.com/Whateverable/0f0acba0af518988ddddeb207fd52fae (the commit you are talking about is listed there as well). In other words, the problem appeared in better-sched branch, and not exactly in the commit you mentioned. Now, talking about the code you've used, it looks a bit weird to me. It seems that you're doing async access to %c which should probably be protected with a lock. In any case, I was able to reproduce the issue without most of that code, by using just qqx. See GH #1202 ( rakudo/rakudo#1202 ). As far as I can see (judging by GH #1202), the issue is much *easier* to reproduce now with better-sched, but the bug was there for a long time. So for the 2017.10 release: SNAFU. On 2017-10-16 18:27:57, jdv79 wrote:
|
From @jdvThe golfed example contained in this ticket and my real world are both fixed after zoffix's fixes. See the other ticket rakudo/rakudo#1202 and commits by |
@jdv - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#132287 (status was 'resolved')
Searchable as RT132287$
The text was updated successfully, but these errors were encountered: