Skip to content

Commit

Permalink
Revert "Remove --experimental_throttle_action_cache_check flag."
Browse files Browse the repository at this point in the history
This reverts commit 1e17348.

This was requested in bazelbuild#19924.

Closes bazelbuild#20162.

PiperOrigin-RevId: 581897901
Change-Id: Ifea2330c45c97db4454ffdcc31b7b7af640cd659
  • Loading branch information
meisterT authored and bazel-io committed Nov 13, 2023
1 parent a6f8923 commit 3afe0c5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,16 @@ public OutputPathsConverter() {
+ " of failing. This is to help use cquery diagnose failures in select.")
public boolean debugSelectsAlwaysSucceed;

@Option(
name = "experimental_throttle_action_cache_check",
defaultValue = "true",
converter = BooleanConverter.class,
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
metadataTags = OptionMetadataTag.EXPERIMENTAL,
effectTags = {OptionEffectTag.EXECUTION},
help = "Whether to throttle the check whether an action is cached.")
public boolean throttleActionCacheCheck;

/** Ways configured targets may provide the {@link Fragment}s they require. */
public enum IncludeConfigFragmentsEnum {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import com.google.devtools.build.lib.runtime.Command;
import com.google.devtools.build.lib.runtime.CommandEnvironment;
import com.google.devtools.build.lib.util.ResourceFileLoader;
import com.google.devtools.common.options.Converters.BooleanConverter;
import com.google.devtools.common.options.Option;
import com.google.devtools.common.options.OptionDocumentationCategory;
import com.google.devtools.common.options.OptionEffectTag;
Expand Down Expand Up @@ -253,16 +252,6 @@ public static class BuildGraveyardOptions extends OptionsBase {
help = "This option is deprecated and has no effect and will be removed in the future.")
public boolean deferParamFiles;

@Option(
name = "experimental_throttle_action_cache_check",
defaultValue = "true",
converter = BooleanConverter.class,
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
metadataTags = OptionMetadataTag.EXPERIMENTAL,
effectTags = {OptionEffectTag.EXECUTION},
help = "no-op")
public boolean throttleActionCacheCheck;

@Option(
name = "check_fileset_dependencies_recursively",
defaultValue = "true",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,10 @@ void prepareForExecution(
freeDiscoveredInputsAfterExecution =
!trackIncrementalState && options.getOptions(CoreOptions.class).actionListeners.isEmpty();

this.cacheHitSemaphore = new Semaphore(ResourceUsage.getAvailableProcessors());
this.cacheHitSemaphore =
options.getOptions(CoreOptions.class).throttleActionCacheCheck
? new Semaphore(ResourceUsage.getAvailableProcessors())
: null;

this.actionExecutionSemaphore =
buildRequestOptions.useSemaphoreForJobs ? new Semaphore(buildRequestOptions.jobs) : null;
Expand Down

0 comments on commit 3afe0c5

Please sign in to comment.