-
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
Conversation
Create an encapsulating DownloadException to represent the aggregate exception set of an ActionResult download. IOExceptions will be retained through exception suppression, and the outer exception has a property to indicate if it only represents a sequence of CacheNotFoundExceptions. InterruptedExceptions interception is improved to cancel pending work and wrap, through suppression, any DownloadException that also occurred during the download. InterruptedException being thrown on the download control thread, it does not require suppression of further interrupts, and can represent an outer download exception. Thread interrupt status is suppressed for cancellations, and conveyed on throw. These exception wrapping efforts allow non-asynchronous frame representation in stack traces, and much clearer identification of sources within remote strategy execution which produce failures based on remote errors. Any DownloadException in the last-ditch output download under handleError in RemoteSpawnRunner is added as suppressed to the initiating exception. Other exceptions (likely local IO) present clear immediate traces and do not require specialized treatment.
I am not sure how I feel about this change. In part because it seems to be treating a symptom instead of the root cause: If you see a stacktrace from Bazel then I'd consider this a bug. Would you agree? |
I think that might be an oversimplification of the presentation of a stack trace - fwiw this doesn't change the current behavior of only making these traces visible with |
@jin ping on triage for this To any future reviewers, this does not add stack traces where they did not exist before. This only improves the quality of existing RuntimeExceptions from skyframe or exceptions printed with --verbose_failures. |
Sorry, was OOO. This looks like a general developer experience improvement. @philwo wdyt? |
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 generally looks like an improvement.
src/main/java/com/google/devtools/build/lib/remote/RemoteCache.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/remote/RemoteCache.java
Outdated
Show resolved
Hide resolved
add(e); | ||
} | ||
|
||
void add(IOException e) { |
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.
Why not override addSuppressed?
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 wanted a filter on this, so that it couldn't contain/suppress anything but IOExceptions. That is probably unnecessary, but I felt it needed scope.
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.
And as it turns out, addSuppressed is final
src/main/java/com/google/devtools/build/lib/remote/RemoteCache.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnCache.java
Outdated
Show resolved
Hide resolved
And make it an IOException
Skip unnecessary self-suppressed test
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.
LGTM, just a documentation nit
add(e); | ||
} | ||
|
||
void add(IOException e) { |
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.
Can you add documentation that this works like addSuppressed and that we can't override addSuppressed?
IOException ioEx; | ||
if (cause instanceof IOException) { | ||
ioEx = new IOException(cause); | ||
} else { | ||
ioEx = (IOException) cause; | ||
} |
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.
IOException ioEx; | |
if (cause instanceof IOException) { | |
ioEx = new IOException(cause); | |
} else { | |
ioEx = (IOException) cause; | |
} | |
IOException ioEx = cause instanceof IOException ? (IOException) cause : new IOException(cause); |
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.
There's a better solution to this that looks more like what's available in RemoteCache.java, i'll refactor that and replace this.
src/main/java/com/google/devtools/build/lib/remote/BulkTransferException.java
Outdated
Show resolved
Hide resolved
* its place to selectively filter and record whether all suppressed | ||
* exceptions are CacheNotFoundExceptions | ||
*/ | ||
void add(IOException e) { |
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.
…rException.java Co-Authored-By: Ulf Adams <ulfjack@users.noreply.github.com>
All transfers use this routine to wait for future list completion with optional cancellation, which replaces waitForUploads. Download futures are strongly encouraged to present IOExceptions through getFromFuture. Removed unused getFromFuture instance method. Upload cancellations, whether from inputs or outputs, remain disabled due to bazelbuild#10846.
Can we see this through? The problem that this corrects in >1.1.0 is keeping us from upgrading to 3.0.0 or even any 2. @philwo? |
I can bring it in. |
If this could be part of 3.1 that would be excellent. |
cc @laurentlb (release manager for 3.1 #11076) |
Sounds good. Please leave a comment on #11076 with the commit hash. |
Any movement here? We need a commit in master before we can get ourselves into the running for 3.1 |
Yes. Phillipp is OOO so I'm requesting for another reviewer internally.
…On Wed, Apr 15, 2020 at 5:13 AM George Gensure ***@***.***> wrote:
Any movement here? We need a commit in master before we can get ourselves
into the running for 3.1
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#10029 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACU6DU7A452IZTH73LBKMDRMTGXVANCNFSM4JAUGV3Q>
.
|
Create an encapsulating DownloadException to represent the aggregate exception set of an ActionResult download. IOExceptions will be retained through exception suppression, and the outer exception has a property to indicate if it only represents a sequence of CacheNotFoundExceptions. InterruptedExceptions interception is improved to cancel pending work and wrap, through suppression, any DownloadException that also occurred during the download. InterruptedException being thrown on the download control thread, it does not require suppression of further interrupts, and can represent an outer download exception. Thread interrupt status is suppressed for cancellations, and conveyed on throw. These exception wrapping efforts allow non-asynchronous frame representation in stack traces, and much clearer identification of sources within remote strategy execution which produce failures based on remote errors. Any DownloadException in the last-ditch output download under handleError in RemoteSpawnRunner is added as suppressed to the initiating exception. Other exceptions (likely local IO) present clear immediate traces and do not require specialized treatment. Closes #10029. PiperOrigin-RevId: 306619678
Create an encapsulating DownloadException to represent the aggregate exception set of an ActionResult download. IOExceptions will be retained through exception suppression, and the outer exception has a property to indicate if it only represents a sequence of CacheNotFoundExceptions. InterruptedExceptions interception is improved to cancel pending work and wrap, through suppression, any DownloadException that also occurred during the download. InterruptedException being thrown on the download control thread, it does not require suppression of further interrupts, and can represent an outer download exception. Thread interrupt status is suppressed for cancellations, and conveyed on throw. These exception wrapping efforts allow non-asynchronous frame representation in stack traces, and much clearer identification of sources within remote strategy execution which produce failures based on remote errors. Any DownloadException in the last-ditch output download under handleError in RemoteSpawnRunner is added as suppressed to the initiating exception. Other exceptions (likely local IO) present clear immediate traces and do not require specialized treatment. Closes #10029. PiperOrigin-RevId: 306619678
ActionResult Orphaned Output Directories must be wrapped in BulkTransferExceptions in order to be eligible for re-execution. This change prevents an unavoidable build failure introduced with bazelbuild#10029 in the event that an output directory tree specified in an action result is missing from the CAS.
ActionResult Orphaned Output Directories must be wrapped in BulkTransferExceptions in order to be eligible for re-execution. This change prevents an unavoidable build failure introduced with bazelbuild#10029 in the event that an output directory tree specified in an action result is missing from the CAS, and adds testing that would detect such a regression.
ActionResult Orphaned Output Directories must be wrapped in BulkTransferExceptions in order to be eligible for re-execution. This change prevents an unavoidable build failure introduced with #10029 in the event that an output directory tree specified in an action result is missing from the CAS, and adds testing that would detect such a regression. Closes #11140. PiperOrigin-RevId: 307027914
Create an encapsulating DownloadException to represent the aggregate exception set of an ActionResult download. IOExceptions will be retained through exception suppression, and the outer exception has a property to indicate if it only represents a sequence of CacheNotFoundExceptions. InterruptedExceptions interception is improved to cancel pending work and wrap, through suppression, any DownloadException that also occurred during the download. InterruptedException being thrown on the download control thread, it does not require suppression of further interrupts, and can represent an outer download exception. Thread interrupt status is suppressed for cancellations, and conveyed on throw. These exception wrapping efforts allow non-asynchronous frame representation in stack traces, and much clearer identification of sources within remote strategy execution which produce failures based on remote errors. Any DownloadException in the last-ditch output download under handleError in RemoteSpawnRunner is added as suppressed to the initiating exception. Other exceptions (likely local IO) present clear immediate traces and do not require specialized treatment. Closes #10029. PiperOrigin-RevId: 306619678
ActionResult Orphaned Output Directories must be wrapped in BulkTransferExceptions in order to be eligible for re-execution. This change prevents an unavoidable build failure introduced with #10029 in the event that an output directory tree specified in an action result is missing from the CAS, and adds testing that would detect such a regression. Closes #11140. PiperOrigin-RevId: 307027914
The fix was cherrypicked on Friday. |
@laurentlb we've been building since rc3 was cut and haven't found any other blockers, thanks for the cherry pick! |
Create an encapsulating DownloadException to represent the aggregate
exception set of an ActionResult download. IOExceptions will be retained
through exception suppression, and the outer exception has a property to
indicate if it only represents a sequence of CacheNotFoundExceptions.
InterruptedExceptions interception is improved to cancel pending work
and wrap, through suppression, any DownloadException that also occurred
during the download. InterruptedException being thrown on the download
control thread, it does not require suppression of further interrupts,
and can represent an outer download exception. Thread interrupt status
is suppressed for cancellations, and conveyed on throw.
These exception wrapping efforts allow non-asynchronous frame
representation in stack traces, and much clearer identification of
sources within remote strategy execution which produce failures based on
remote errors.
Any DownloadException in the last-ditch output download under
handleError in RemoteSpawnRunner is added as suppressed to the
initiating exception. Other exceptions (likely local IO) present clear
immediate traces and do not require specialized treatment.