Skip to content
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

Pass more information to top exception on build cache load/store failure #19672

Merged
merged 7 commits into from
Feb 22, 2022

Conversation

asodja
Copy link
Member

@asodja asodja commented Jan 24, 2022

Now we pass more information to the top-level exception.

If previously exception was like:

Failed to load cache entry for task ':compileKotlin'
> Build cache entry xxx from local build cache is invalid
  > Unable to delete directory

Then top-level exception message looks like this now for load operation:

Failed to load cache entry xxx from local build cache for task ':compileKotlin': Unable to delete directory

Also, we don't say anymore: Build cache entry xxx from local build cache is invalid since this might be confusing. It is changed to: Exception occurred while loading cache entry xxx from local build cache

I also changed the error for store operation to have similarly more information on the top-level as load has.

Fixes #17208

@asodja asodja requested a review from a team as a code owner January 24, 2022 07:36
@bot-gradle bot-gradle added this to the 7.5 RC1 milestone Jan 24, 2022
@asodja asodja self-assigned this Jan 24, 2022
@asodja asodja force-pushed the asodja/build-cache-exceptions branch from 03572b3 to bd977fa Compare February 21, 2022 07:13
@gradle gradle deleted a comment from asodja Feb 21, 2022
@gradle gradle deleted a comment from asodja Feb 21, 2022
@asodja asodja force-pushed the asodja/build-cache-exceptions branch from 8b1e038 to b21c17c Compare February 21, 2022 08:21
@asodja asodja force-pushed the asodja/build-cache-exceptions branch from b21c17c to f89c3e8 Compare February 21, 2022 08:38
@asodja
Copy link
Member Author

asodja commented Feb 21, 2022

@bot-gradle test this

@gradle gradle deleted a comment from asodja Feb 21, 2022
@bot-gradle
Copy link
Collaborator

OK, I've already triggered the following builds for you:

@@ -217,7 +217,7 @@ class BuildCacheStepTest extends StepSpec<IncrementalChangesContext> implements

then:
def ex = thrown Exception
ex.message == "Failed to store cache entry $cacheKeyHashCode for job ':test': store failure"
ex.message == "Failed to store cache entry 30a042b90a for job ':test': store failure"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intentional? Why not use the variable instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is. This was not changed when fixing: #19672 (comment)

Copy link
Member

@lptr lptr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@asodja
Copy link
Member Author

asodja commented Feb 22, 2022

@bot-gradle test and merge

@gradle gradle deleted a comment from asodja Feb 22, 2022
@bot-gradle
Copy link
Collaborator

Your PR is queued. See the queue page for details.

@bot-gradle
Copy link
Collaborator

OK, I've already triggered a build for you.

@bot-gradle bot-gradle merged commit 862abb1 into master Feb 22, 2022
@blindpirate blindpirate deleted the asodja/build-cache-exceptions branch February 24, 2022 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Confusing error message when build cache can't clean output directory
3 participants