Reduce the impact of Maven Central outages#14805
Conversation
hashhar
left a comment
There was a problem hiding this comment.
At this point I think it'd be much simpler to add a step which does mvn dependency:go-offline and use that to prepare cache instead of trying to keep track of which job produces most complete cache.
(Or add mvn dependency:go-offline to an existing job which we chose to populate cache).
I didn't know about |
d3f4cd3 to
bef0cbb
Compare
I'd rather not overpromise, since there are many failure modes this PR won't help with, and they all look like #14618
#14803 looks like a network problem in GitHub. |
|
@MiguelWeezardo It'd be useful to measure how much time a separate |
I misread your comment, sorry. I agree it should be faster by adding a new step not a whole job. |
bef0cbb to
3b5d26b
Compare
hashhar
left a comment
There was a problem hiding this comment.
LGTM. (I did try to verify all jobs except build-pt have the "Clean local Maven repo" step but I obviously did it by eye so would appreciate someone rechecking).
|
BTW GitHub recently added a view for caches, when you go to the actions tab check the lower left corner: |
3b5d26b to
719f0ce
Compare
Yes, and it's clear that some incomplete caches are being created (notice the size of the last entry): |
719f0ce to
43c1d2d
Compare
`setup-java` action caches the local Maven repo once a job succeeds. The cache key for Maven depends only on the hash of all pom.xml files. By uploading caches from a job which only builds one module we are forcing Maven to download missing dependencies during each build.
42cb054 to
40e946f
Compare
When uploading a new cache entry it's important that the entry be complete, to avoid the need of downloading more dependencies during build. This change explicitly downloads all dependencies in `maven-checks` job which already builds all modules, to minimize additional work.
40e946f to
54b8b8b
Compare
|
Thanks @MiguelWeezardo for this. |


Description
When
setup-javaaction is called withmavencache, a cache entry is uploaded upon job success.Cache keys for Maven are based on a hash of all
pom.xmlfiles in the repository.We need to ensure that cache entries contain all Trino dependencies.
If a PR which compiles just one module
Mgets merged after creating a cache entry, subsequent PRs which don't change anypom.xmlfiles will use that cache entry and will be forced to download all dependencies which weren't onM's dependency list. Not only is this slow, it also introduces a failure point since Maven Central suffers from occasional outages.This should help with issues like #14618.
Non-technical explanation
Make sure Maven cache contains all Trino dependencies, to avoid downloading them during build.
Release notes
(x) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text: