Repository navigation
[8.9.0] Add --experimental_max_repeated_lost_inputs to make the action-rewind… - #32354
Merged
Merged
Conversation
…ing lost-input limit configurable (bazelbuild#30164) ## Problem Action rewinding gives up — failing the build with `LOST_INPUT_TOO_MANY_TIMES` / `LOST_OUTPUT_TOO_MANY_TIMES` — once the same action loses the same input/output more than a hardcoded `MAX_REPEATED_LOST_INPUTS = 20` times (`ActionRewindStrategy`). We're rolling out `--rewind_lost_inputs`, and when the remote cache is unstable, spending up to 20 rewind cycles per lost input is the wrong tradeoff: we'd rather **give up early and re-run the build without the cache** than grind against a cache that keeps evicting intermediate blobs (the "20× slower" path). Today the give-up threshold is hardcoded, so there is no way to fail fast short of patching Bazel. ## Change Adds `--experimental_max_repeated_lost_inputs` (default `20`, behavior-preserving), threaded through `BuildRequestOptions` → `SkyframeActionExecutor` (cached per build in `prepareForExecution`, exposed via `maxRepeatedLostInputs()`) → `ActionRewindStrategy`, mirroring the existing `--rewind_lost_inputs` wiring. Lower it to give up sooner — `0` fails on the first lost input. It governs both the lost-input and lost-top-level-output give-up checks. The `MAX_REPEATED_LOST_INPUTS` constant is retained as the default and test anchor. ## Test The existing `ineffectiveRewindingResultsInLostInputTooManyTimes` `RewindingTest` case is now parameterized with `@TestParameter({"2", "20"})`: it sets `--experimental_max_repeated_lost_inputs` to each value and asserts the same repeatedly-lost input causes give-up on attempt N+1, covering both a lowered limit and the default. Closes bazelbuild#30164. PiperOrigin-RevId: 950819794 Change-Id: Ic3c34c791aec8f1944691fb4d609a9913d942297
iancha1992
enabled auto-merge
November 2, 2026 22:46
Member
Author
|
Cherry-pick of 33a59c4 (#30164) into The following files had merge conflicts or required manual adjustments for
|
justinhorvitz
approved these changes
Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ing lost-input limit configurable (#30164)
Problem
Action rewinding gives up — failing the build with
LOST_INPUT_TOO_MANY_TIMES/LOST_OUTPUT_TOO_MANY_TIMES— once the same action loses the same input/output more than a hardcodedMAX_REPEATED_LOST_INPUTS = 20times (ActionRewindStrategy).We're rolling out
--rewind_lost_inputs, and when the remote cache is unstable, spending up to 20 rewind cycles per lost input is the wrong tradeoff: we'd rather give up early and re-run the build without the cache than grind against a cache that keeps evicting intermediate blobs (the "20× slower" path). Today the give-up threshold is hardcoded, so there is no way to fail fast short of patching Bazel.Change
Adds
--experimental_max_repeated_lost_inputs(default20, behavior-preserving), threaded throughBuildRequestOptions→SkyframeActionExecutor(cached per build inprepareForExecution, exposed viamaxRepeatedLostInputs()) →ActionRewindStrategy, mirroring the existing--rewind_lost_inputswiring. Lower it to give up sooner —0fails on the first lost input. It governs both the lost-input and lost-top-level-output give-up checks. TheMAX_REPEATED_LOST_INPUTSconstant is retained as the default and test anchor.Test
The existing
ineffectiveRewindingResultsInLostInputTooManyTimesRewindingTestcase is now parameterized with@TestParameter({"2", "20"}): it sets--experimental_max_repeated_lost_inputsto each value and asserts the same repeatedly-lost input causes give-up on attempt N+1, covering both a lowered limit and the default.Closes #30164.
PiperOrigin-RevId: 950819794
Change-Id: Ic3c34c791aec8f1944691fb4d609a9913d942297
Description
Motivation
Build API Changes
No
Checklist
Release Notes
RELNOTES: None
Commit 33a59c4