-
Notifications
You must be signed in to change notification settings - Fork 293
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
Java virtual threads locked up / parking / permanently blocking -- swap synchronized block for reentrant lock #339
base: POOL_2_X
Are you sure you want to change the base?
Conversation
Hello @Brian1KB Thank you for your report. Please add a unit test to this PR. |
To add a unit test, I'd need to include a |
Untested, but I'd expect something like this would suffice. |
Hi @garydgregory, could you or anyone else please help/guide @Brian1KB about tests? On a side note, this PR changes the locking mechanism to use Java |
Is there anything I can help with to make it merged and released? We are eager to use Jedis with Virtual Threads and we cannot do this without this fix and then a release of Jedis with this dependency updated! |
I second @sazzad16 's plea for assistance – @garydgregory could this be merged without additional unit tests, as this behavior is already covered by preexisting tests? |
Hello all and @psteitz My view here is twofold:
|
This PR resolves an actively occurring issue with virtual threads that is easily reproducible. If you call borrowObject within the GenericObjectPool at a high rate in a short period of time with virtual threads, all of the threads within the ForkJoinPool for virtual threads will lock up & park, and no virtual threads will resume.
I've already seen there is another Loom related PR that has existed for over a year, and I hope that including this demonstration of a production issue will hope speed up the process for getting this resolved. The demo will print "attempting to acquire", but never "acquired". If you apply my PR, this issue is resolved -- in addition, it passes all existing unit tests.
I'm confident that there are other similar issues within the project, though I would sure imagine that the maintainers would have a better idea of where to look for such problems. Additionally, I'm confident this is not the correct branch to PR to, and if I could have I would've filed an issue instead & left this part to more competent hands, but the sign up process for the JIRA was too complex, and figuring out how to use a mailing list might be more complex for me than debugging this issue was.