Uh oh!
There was an error while loading. Please reload this page.
Gitlab corrupted cache metadata mitigation - #11515
Conversation
|
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
Uh oh!
There was an error while loading. Please reload this page.
| private static void loadMetadataReader() { | ||
| try { | ||
| var storeClass = | ||
| Class.forName("org.gradle.internal.execution.history.impl.DefaultImmutableWorkspaceMetadataStore"); | ||
| metadataStore = storeClass.getDeclaredConstructor().newInstance(); | ||
| metadataLoadMethod = storeClass.getMethod("loadWorkspaceMetadata", java.io.File.class); | ||
| } catch (ReflectiveOperationException | LinkageError e) { | ||
| throw new IllegalStateException("could not load Gradle metadata reader: " + summarize(e)); | ||
| } | ||
| } |
There was a problem hiding this comment.
note: That looks a bit brittle, but I don't see it another way. That might be worth requesting a feature from Gradle folks (even if it takes years)
There was a problem hiding this comment.
Yep, Gradle actually should not crash on that, just log a warning and recover
| var storeClass = Class.forName( | ||
| "org.gradle.internal.execution.history.impl.DefaultImmutableWorkspaceMetadataStore"); | ||
| metadataStore = storeClass.getDeclaredConstructor().newInstance(); | ||
| metadataLoadMethod = storeClass.getMethod("loadWorkspaceMetadata", File.class); |
There was a problem hiding this comment.
issue: This changed Gradle 9.
- 8.14.5:
DefaultImmutableWorkspaceMetadataStore.loadWorkspaceMetadataAssignImmutableWorkspaceStep.loadImmutableWorkspaceIfConsistent - 9.5.1:
DefaultImmutableWorkspaceMetadataStore.loadWorkspaceMetadataAssignImmutableWorkspaceStep.loadImmutableWorkspaceIfComplete
I would believe that Gradle 9.x handle the bad metadata more gracefully due to the use of Optional, before it raised an UncheckedIOExcewption, now it returns Optional.empty()
5402974 to
922533bCompareAfter looking into changes in Gradle 9.x, more precisely Gradle 9.4, the corrupt metadata should no longer be a problem, see gradle/gradle#36227 and more precisely the changes I mention in #11515 (comment) So bumping to Gradle 9.5.1 should get rid of these issues. Note the force push, is me removing a commit I did above, but deemed it useless, given the Gradle 9 behavior change |
AlexeyKuznetsov-DD
commented
Jun 17, 2026
Closing PR since Gradle 9.5.x can recover from such errors/ |
What Does This Do
A fix for when cache restore failed on GitHub:
FATAL: unexpected EOFMotivation
Quite a lot of jobs started to fail on GitLab randomly with error
FATAL: unexpected EOFsince May 22.After some investigation I found a way to workaround the issue by clearing corrupted
metadata.binfiles.That allows to restore cache as part of the build.
Additional Notes
Real issue should be fixed at GitLab. This PR is a way to unblock merging to master.