bazelbuild / bazelbuild/bazel

Custom RBE timeout for non-test actions

Open
#21,142 1 comment 2 reactions 1 assignee Claimed by @coeuvre View on GitHub
P2 team-Remote-Exec type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 16h
Merged PRs (30d)
72

Description

### Description of the feature request:

RBE action timeouts for test actions can be increased using the `--test_timeout` flag, otherwise the default timeout for RBE actions is one hour.

Bazel can already request a different timeout from RBE (read from execution info [here](https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/actions/Spawns.java;l=144-171;drc=ca728739071c78c67b5d251c7be4b9ba7c17b225), into SpawExecutionContext [here](https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/exec/AbstractSpawnStrategy.java;l=130-132;drc=ca728739071c78c67b5d251c7be4b9ba7c17b225), and into the remote action builder [here](https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/remote/RemoteExecutionService.java;l=597;drc=ca728739071c78c67b5d251c7be4b9ba7c17b225)), but there is no API to do so for non-test actions. My dirty fix at the moment is [this](https://github.com/bazelbuild/bazel/commit/5de1f35f9f27f08791c70ed4248b0572239e4452) + setting a timeout in the `execution_requirements` of the `ctx.actions.run` call. It works, though I suspect it would break anyone using "timeout" as a tag in their rule (this could be worked around by maintaining 2 separate lists for tags specified in target definitions vs `execution_requirements` specified from a `ctx.actions.run` call).

More generally it seems the list of exec_info keys that we let users specify is intentionally short, so filing this as a feature request in case my approach has unintended consequences I haven't thought of.

### Which category does this issue belong to?

Remote Execution

### What underlying problem are you trying to solve with this feature?

_No response_

### Which operating system are you running Bazel on?

_No response_

### 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 HEAD` ?

_No response_

### Have you found anything relevant by searching the web?

https://github.com/bazelbuild/bazel/issues/12349 would likely be solved by this.

### Any other information, logs, or outputs that you want to share?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.