Skip to content

Commit

Permalink
Set --remote_cache to --remote_executor if it is empty.
Browse files Browse the repository at this point in the history
Fixes #11913

Closes #11998.

PiperOrigin-RevId: 328487098
  • Loading branch information
coeuvre authored and Copybara-Service committed Aug 26, 2020
1 parent 5150ce1 commit 25e58ff
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,13 @@ public void beforeCommand(CommandEnvironment env) throws AbruptExitException {

boolean enableDiskCache = RemoteCacheClientFactory.isDiskCache(remoteOptions);
boolean enableHttpCache = RemoteCacheClientFactory.isHttpCache(remoteOptions);
boolean enableGrpcCache = GrpcCacheClient.isRemoteCacheOptions(remoteOptions);
boolean enableRemoteExecution = shouldEnableRemoteExecution(remoteOptions);
// If --remote_cache is empty but --remote_executor is not, endpoint for cache should be the one
// for execution.
if (enableRemoteExecution && Strings.isNullOrEmpty(remoteOptions.remoteCache)) {
remoteOptions.remoteCache = remoteOptions.remoteExecutor;
}
boolean enableGrpcCache = GrpcCacheClient.isRemoteCacheOptions(remoteOptions);
boolean enableRemoteDownloader = shouldEnableRemoteDownloader(remoteOptions);

if (enableRemoteDownloader && !enableGrpcCache) {
Expand Down Expand Up @@ -292,8 +297,7 @@ public void beforeCommand(CommandEnvironment env) throws AbruptExitException {
}
// Create a separate channel if --remote_executor and --remote_cache point to different
// endpoints.
if (Strings.isNullOrEmpty(remoteOptions.remoteCache)
|| remoteOptions.remoteCache.equals(remoteOptions.remoteExecutor)) {
if (remoteOptions.remoteCache.equals(remoteOptions.remoteExecutor)) {
cacheChannel = execChannel.retain();
}
}
Expand Down

0 comments on commit 25e58ff

Please sign in to comment.