Don't abort with nonzero exit codes on Build Event Service timeout
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the feature request:
Currently, the default behavior of Bazel is to abort with a nonzero exit code if it times out when communicating with a Build Event Service. We think it would be preferable if builds behaved as normal and only displayed a warning if communication with the Build Event Service were to fail, alternatively if there was a flag to toggle between these two behaviors.
### What underlying problem are you trying to solve with this feature?
A Build Event Service allows us to collect information about our builds, which can help us improve how our builds are structured or how our caches and remote execution is set up. It is however not strictly needed in order for the builds to complete. With the current functionality of Bazel, BES timeouts cause nonzero exit codes, which means that a build can appear to fail even if nothing is wrong with it.
This issue applies to the `--bes_upload_mode` `wait_for_upload_complete`, which is the default, and it becomes the most noticable in the context of automated Bazel invocations. Automated tooling can normally look at the exit code of a Bazel invocation to see whether or not a build or test has failed, but this is not reliable when using a Build Event Service.
### Which operating system are you running Bazel on?
Red Hat Enterprise Linux 7.9
### What is the output of `bazel info release`?
_No response_
### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.
_No response_
### What's the output of `git remote get-url origin; git rev-parse master; git rev-parse HEAD` ?
_No response_
### Have you found anything relevant by searching the web?
_No response_
### Any other information, logs, or outputs that you want to share?
_No response_
Contributor guide
Research direction
Start by tracing Bazel's handling of the --bes_upload_mode wait_for_upload_complete option and the Build Event Service timeout path. Determine how a timeout currently affects the invocation exit code, then verify that builds complete normally with a warning while preserving an option for the existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100