-
Notifications
You must be signed in to change notification settings - Fork 574
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
[BUG] Some code changes for reproducing queue hangs up #124
Conversation
This algorithm allows me to reproduce the problem with a probability of about 100%. I think only SingleConsumerLinkedArrayQueue author @pron can help with my problem. |
I will take a look, but in the meantime you can use |
Thanks. I will try to replace queue in Channels.newChannel and test our code. |
I tried to replace SingleConsumerLinkedArrayQueue by SingleConsumerLinkedObjectQueue and looks like hangs on SingleConsumerLinkedQueue.succ():
Unfortunately, I have not yet know how to reproduce this problem in a small test. |
Oh boy. I'll try to submit a fix some time next week. |
Can you post a full stack trace (or at least as many frames up the stack as you can)? |
Actually, the two failures suggest a common cause, which might make this easy to pinpoint (and if so the fix will be much quicker). They suggest the bug may be in the channel rather than the queue. A stack trace would help greatly. |
Stacktrace with SingleConsumerLinkedQueue:
|
Used quasar code version 0.7.3 |
I create similar class SingleConsumerLinkedObjectQueueTest for reproducing problem in SingleConsumerLinkedObjectQueue I have a following way to reproduce problem:
|
Can you try the 0.7.0 branch now (with the latest commit: dcf669b), still with |
Hello. I try this change with "breakpoint" test and it's have no effects: programm hangs in infinity loop. Now I found a very strange thing: when I stop at a breakpoint, I see in Idea two different stacktraces on a single thread: Stacktrace, getted by Idea "Get thread dump" button (button with photocamera icon):
Stacktrace on "Debugger" tab:
I am currently trying to find an explanation for this phenomenon. |
I change queue to SingleConsumerLinkedQueue, apply dcf669b and rebuild quasar. After that I run out project: it looks like worked. Currently the code has been successfully operating in 15 minutes. Previously, he hangup somewhere for 30 seconds. |
Good! Now, I'll try to find the bug in the linked-array queue. |
Looks like "breakpoint" test is really incorrect: there is some JIT black magic. Fix from dcf669b really helps to us. Thanks a lot. |
Alright, so I've made another single-line commit -- 5179c26 -- that will hopefully fix the original issue with the linked-array queue. It's on the 0.7.0 branch (or you can manually apply it). Please try and let me know. |
I change queue back to SingleConsumerLinkedArrayQueue, apply 5179c26 and rebuild quasar. After that I run out project: it looks like worked. |
Excellent! As it turns out, those were two different bugs in the two queues, but the reason they went unnoticed until now is that they only manifest if you do a lot of selective receives. |
Thanks a lot 🍻 |
I have a problem: some times server hangs up in method SingleConsumerLinkedArrayQueue.prePeek() with infinity loop on line:
I try to localize this problem and have a following way to reproduce it:
After that "consumer" thread hangs in infinity loop on SingleConsumerLinkedArrayQueue.java:76
I tried to get rid of breakpoints in this test, but could not :(
I also do not understand how this queue works.
I tested this problem on Oracle JDK 1.8.0_45, Oracle JDK 1.8.0_60 and OpenJDK 1.8.0_45