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
Deadlock on ProgressReport #151
Comments
Hi Dinesh, thanks for the feedback! I'm trying to fix this issue in PR #152, can you confirm this PR fixes your case? |
Thank you @alban-auzeill for this quick fix. I will not be able to test this fix before quite some time, however looking at your PR I am confident it will resolve this issue. I suggest to merge the PR and close this issue: I will open a new one in the unlikely case the problem is still there. |
Great job @alban-auzeill ; I have just managed to verify that this issue is now indeed fixed. Well done and thank you! |
I observed a deadlock on
ProgressReport
during the execution of tests on a Java custom rules plugin written against SonarQube LTS 8.9 and sonar-java version 6.15.1.26025 which depends on sonar-analyzer-commons version 1.15.0.699.Here is the jstack dump:
Now this seems to be quite a tricky state to be in:
ProgressReport.stop()
has been called, which interrupted ProgressReport's threadsleep()
The Javadoc for
[Thread.interrupted()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#interrupted--)
says:As this behavior occurs only in a unit test scanning a single file (which is fast), one explanation might be that
stop()
is being called before ProgressReport's thread becomes alive, thus turning the interruption sent bystop()
into a no-operation. This deadlock is observable from one machine (not all) and there was at least one successful run which did not encounter this deadlock.It might be safer to rely on a custom flag rather than the thread interruption status to exit from the progress report thread, given that the later depends on native methods of the JVM which seem hard to understand and which might slightly change between releases.
The text was updated successfully, but these errors were encountered: