-
Notifications
You must be signed in to change notification settings - Fork 33
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
model checking hangs in 2.16 on jdk 19 #130
Comments
Interestingly this passed in 20-ea https://github.com/ben-manes/caffeine/actions/runs/3529461192/jobs/5920532925 |
I profiled and found that it is throwing
If I remove the offending code then the test passes. In this case it is an optimization to more aggressively resubmit onto the common pool if work remains, else wait for the next triggering action. I don't know why other JDK versions wouldn't suffer this problem and only on jdk19 with 2.16 does it break. /**
* Performs the maintenance work, blocking until the lock is acquired.
*
* @param task an additional pending task to run, or {@code null} if not present
*/
void performCleanUp(@Nullable Runnable task) {
evictionLock.lock();
try {
maintenance(task);
} finally {
evictionLock.unlock();
}
if ((drainStatusOpaque() == REQUIRED) && (executor == ForkJoinPool.commonPool())) {
scheduleDrainBuffers();
}
} |
Oh, I missed this initialization exception for the static load,
I can reproduce eagerly to fail the test by adding |
Lincheck's classloader will rewrite usages of ForkJoin's commonPool to an instrumented instance. This requires opening additional modules for access, or else a static initialization failure is thrown and the class is left in an invalid state. This results in the test rerunning indefinitely. Once this module restriction is lifted it is able to proceed as expected and validate that the cache passes linearization tests. JetBrains/lincheck#130
Hi @ben-manes ! So, in short, it seems the error is caused by lazy static initialization in concurrent threads leading to a deadlock. |
Hi @alefedor The summary is that The important fix is to always rethrow The user change is to include add-opens directives for |
Hi, @ben-manes! It has taken a while to address the issue, but the recent 2.30 release should've fixed it. Could you please check? |
oh yes, this is fixed. I am on 2.29 now as I ran into a bug where Lincheck self terminates when its hung,
I reported it under #311 but my simplification was a misdirect, so I'll update that issue title. |
When upgrading from 2.15, a previously successful test hangs and times out on CI. I was able to reproduce this locally on jdk19 (both 11 and 17 passed). Using jps for the pid and jstack for the stacktrace, I could see that it was always doing work within lincheck methods. Sorry that I cannot provide more insights.
JAVA_VERSION=19 ./gradlew caffeine:lincheckTest
https://github.com/ben-manes/caffeine/actions/runs/3528817208/jobs/5919342189
The text was updated successfully, but these errors were encountered: