-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fix project cache plugin exception handling #6345
Fix project cache plugin exception handling #6345
Conversation
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
StringShouldContainSubstring(logger.FullLog, $"{AssemblyMockCache}: EndBuildAsync", expectedOccurrences: 1); | ||
} | ||
|
||
// TODO: this ain't right now is it? |
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.
To be done in the follow-up PR, or is this leftover? 🤔
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.
Yup, followup-pr: #6368
This PR just fixes the exception handling part, follow-up PR does the logging.
Context
The project cache plugin can fail with exceptions from any of its APIs. Currently some exceptions from certain APIs get lost and the build fails with no errors.
This PR ensures that:
Changes Made
BuildManager.ExecuteSubmission(BuildSubmission)
always completes the build submission with the exception when it detects that it's running in a detached thread.BuildManager.BuildGraph
observes the exceptions captured above and rethrows them to mimic what happens whenExecuteSubmission(BuildSubmission)
does not run in a detached thread.BuildManager.EndBuild
marks the overall build result as failed if exceptions are thrown inBM.EndBuild
.Testing
Added unit tests to ensure that exceptions thrown from any possible plugin API are observable.
Notes
This is an intermediary implementation to avoid lost exceptions. A better implementation which I'm working on, builds upon this one and actually logs the plugin exceptions to the
LoggingService
in a similar way to which logger errors get handled.