Skip to content

Conversation

@AlexTereshenkov
Copy link
Contributor

@AlexTereshenkov AlexTereshenkov commented Jan 14, 2026

When attempting to run a Bazel command, Bazel server will shutdown and exit with an unexpected error when the downloader config is invalid:

$ echo "#test\nfoo" > bazel_downloader.cfg
$ cat bazel_downloader.cfg                                                                                                 
#test
foo
$ bazel-dev build //... --downloader_config=bazel_downloader.cfg
< exits immediately with the Bazel server killed >
$ echo $?
37

37 corresponds to Unhandled Exception / Internal Bazel Error as per the docs.

This PR introduces changes that will let catch and rethrow UrlRewriterParseException before Closer.rethrow() to prevent it from being wrapped in RuntimeException.

$ bazel-dev-fixed query //... --downloader_config=bazel_downloader.cfg 
...
ERROR: Failed to parse downloader config at bazel_downloader.cfg:2: Unable to parse: foo
$ echo $?                                 
2

@AlexTereshenkov AlexTereshenkov marked this pull request as ready for review January 14, 2026 16:29
@github-actions github-actions bot added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. awaiting-review PR is awaiting review from an assigned reviewer labels Jan 14, 2026
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request aims to prevent UrlRewriterParseException from being wrapped in a RuntimeException by adding a specific catch block. While the intent is correct, the current implementation introduces a bug related to exception suppression with com.google.common.io.Closer. My review includes a critical comment with a suggested fix to correctly handle the exception without breaking suppression, ensuring that no exception information is lost.

@AlexTereshenkov AlexTereshenkov force-pushed the alexey/url-rewriter-parse-exception-no-wrapping branch from 503678e to 109afa8 Compare January 15, 2026 09:55
@AlexTereshenkov AlexTereshenkov force-pushed the alexey/url-rewriter-parse-exception-no-wrapping branch from 109afa8 to d4339ba Compare January 15, 2026 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review PR is awaiting review from an assigned reviewer team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant