Skip to content

Commit

Permalink
Create a flag to toggle tracking of lost discovered inputs.
Browse files Browse the repository at this point in the history
It is expected that this behavior is not necessary. The flag will allow for thorough vetting before removing it.

While here, update the help string for `--rewind_lost_inputs` to remove outdated prerequisites.

PiperOrigin-RevId: 588409077
Change-Id: I87dbbac0b910a3d90fc4fbf4b722f0d90edbe8c3
  • Loading branch information
justinhorvitz authored and copybara-github committed Dec 6, 2023
1 parent ff0d6db commit 130266b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,19 @@ public String getSymlinkPrefix(String productName) {
defaultValue = "false",
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
effectTags = {OptionEffectTag.EXECUTION},
help =
"Whether to use action rewinding to recover from lost inputs. Ignored unless"
+ " prerequisites for rewinding are met (no incrementality, no action cache).")
help = "Whether to use action rewinding to recover from lost inputs.")
public boolean rewindLostInputs;

@Option(
name = "track_lost_discovered_inputs",
defaultValue = "true",
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
effectTags = {OptionEffectTag.EXECUTION},
help =
"Whether to track lost discovered inputs and proactively request them after rewinding."
+ " This option is a rollout mechanism for removing this behavior, see b/315059768.")
public boolean trackLostDiscoveredInputs;

@Option(
name = "incompatible_skip_genfiles_symlink",
defaultValue = "true",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ public void injectTree(SpecialArtifact output, TreeArtifactValue tree) {
private OutputService outputService;
private boolean finalizeActions;
private boolean rewindingEnabled;
private boolean trackLostDiscoveredInputs;
private final Supplier<ImmutableList<Root>> sourceRootSupplier;

private DiscoveredModulesPruner discoveredModulesPruner;
Expand Down Expand Up @@ -304,6 +305,7 @@ void prepareForExecution(
// Cache some option values for performance, since we consult them on every action.
this.finalizeActions = buildRequestOptions.finalizeActions;
this.rewindingEnabled = buildRequestOptions.rewindLostInputs;
this.trackLostDiscoveredInputs = buildRequestOptions.trackLostDiscoveredInputs;
this.outputService = outputService;
this.outputDirectoryHelper = outputDirectoryHelper;

Expand Down Expand Up @@ -451,7 +453,7 @@ void prepareForRewinding(
// obsolete.
state.obsolete(failedKey, buildActionMap, ownerlessArtifactWrapper);
}
if (!lostDiscoveredInputs.isEmpty()) {
if (trackLostDiscoveredInputs && !lostDiscoveredInputs.isEmpty()) {
lostDiscoveredInputsMap.put(ownerlessArtifactWrapper, lostDiscoveredInputs);
}
if (!actionFileSystemType().inMemoryFileSystem()) {
Expand Down

0 comments on commit 130266b

Please sign in to comment.