-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Suppress last-ditch download exceptions w/cleanup #10029
Closed
Closed
Changes from 18 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
7df4c84
Suppress last-ditch download exceptions w/cleanup
77e5c65
Revert unrelated testing change
58a6103
Merge branch 'master' into remote-traces
b315dcb
Merge branch 'master' into remote-traces
6bb872b
Move DownloadException to remote package
20ad9ed
Revert to previous downloadException behavior
28b94e5
Fix import for tests of DownloadException
7fe3e6b
Remove additional IOException wrappings
455ad69
Document add behavior and addSuppresed final limitation
a371265
Convert to BulkTransferException and handle uploads
6518d20
Merge branch 'master' into remote-traces
9cd8b92
Correct remoteCacheFailed detection for BTE
98bbeb4
Update src/main/java/com/google/devtools/build/lib/remote/BulkTransfe…
werkt 2bb742a
Remove unnecessary BTE wrap
werkt 65c41a8
Route downloadOutErr IOExceptions to future
werkt 32d1684
Refactor bulk transfer wait into a common routine
werkt 97d4911
Merge branch 'master' into remote-traces
werkt cfb2a2d
correct merge error
6c516b9
Merge branch 'master' into remote-traces
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
src/main/java/com/google/devtools/build/lib/remote/BulkTransferException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// Copyright 2020 The Bazel Authors. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
package com.google.devtools.build.lib.remote; | ||
|
||
import com.google.common.base.Preconditions; | ||
import com.google.devtools.build.lib.remote.common.CacheNotFoundException; | ||
import java.io.IOException; | ||
|
||
/** | ||
* Exception which represents a collection of IOExceptions for the purpose | ||
* of distinguishing remote communication exceptions from those which occur | ||
* on filesystems locally. This exception serves as a trace point for the actual | ||
* transfer, so that the intended operation can be observed in a stack, with all | ||
* constituent exceptions available for observation. | ||
*/ | ||
class BulkTransferException extends IOException { | ||
// true since no empty BulkTransferException is ever thrown | ||
private boolean allCacheNotFoundException = true; | ||
|
||
BulkTransferException() { | ||
} | ||
|
||
BulkTransferException(IOException e) { | ||
add(e); | ||
} | ||
|
||
/** | ||
* Add an IOException to the suppressed list. | ||
* | ||
* The Java standard addSuppressed is final and this method stands in | ||
* its place to selectively filter and record whether all suppressed | ||
* exceptions are CacheNotFoundExceptions | ||
*/ | ||
void add(IOException e) { | ||
allCacheNotFoundException &= e instanceof CacheNotFoundException; | ||
super.addSuppressed(e); | ||
} | ||
|
||
boolean onlyCausedByCacheNotFoundException() { | ||
return allCacheNotFoundException; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this can ever be called in a multi-threaded context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It cannot in any of the uses I've added here - all the aggregations happen on a single thread.