-
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
Fix BzlMod exception handling #18629
Comments
@Wyverald Please tell me whether there are more skyfunctions that need to be audited. |
This is a first step towards bazelbuild#18629.
|
I thought you'd only use What the Bzlmod skyfunctions are doing right now essentially means that they can't tolerate any exceptions. Hence whoever is requesting the Bzlmod skyvalues should be aware that they can throw exceptions of various types. I'm not sure what's causing CTF to crash, but it seems to me that we need to fix CTF, not the Bzlmod skyfunctions. We could have the Bzlmod skyfunctions wrap the exception with more info, but that's an enhancement, not a bug fix. |
Okay, based on that I think we need to specifically make the following changes:
We should also audit the other exceptions thrown from |
ExternalDepsException. Part of bazelbuild#18629.
Okay, so I can deal with the error from #18567 if I add checks for However, if I add equivalent checks in So, is the right answer to handle the exception in |
This is a first step towards bazelbuild#18629. Closes bazelbuild#18630. PiperOrigin-RevId: 539698272 Change-Id: I1584c5fa47b591956609e05c8b55467de0f95e2e
ExternalDepsException. Part of bazelbuild#18629. Closes bazelbuild#18648. PiperOrigin-RevId: 539754872 Change-Id: I3d31f823b89952eab2d5ce533947bceb3a1bc205
I can't work on this any further, so I am unassigning it and marking it as untriaged so that the bzlmod team can pick it up. |
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale. |
Almost all of the skyfunctions defined for bzlmod support have no exception handling, which means that when an exception does occur, Skyframe drops it and bazel crashes in an inconsistent state.
Issue #18567 is an example of this.
I've done a brief survey of the existing skyfunctions under src/main/java/com/google/devtools/build/lib/bazel/bzlmod/
Every SkyKey can potentially throw the exceptions listed under its Skyfunction (for example, requesting
BazelDepGraphValue.KEY
can potentially raiseExternalDepsException
.Therefore, each of these functions needs to have existing
env.getValue
calls converted toenv.getValueOrException
calls, and then the exception needs to be handled properly, generally by re-throwing it.The text was updated successfully, but these errors were encountered: