From 9813c58bc59fd7da990ed9f24c73016e339a334d Mon Sep 17 00:00:00 2001 From: George Gensure Date: Wed, 20 Mar 2019 02:59:44 -0700 Subject: [PATCH] Suppress DEADLINE_EXCEEDED on download progress Prevent DEADLINE_EXCEEDED from contributing to retry counter when it is making progress, and preserve progress in between retry attempts on a single file. Closes #5230. PiperOrigin-RevId: 239363567 --- .../lib/remote/AbstractRemoteActionCache.java | 52 ++----- .../build/lib/remote/GrpcRemoteCache.java | 137 +++++++++++++++--- .../build/lib/remote/RemoteModule.java | 7 - .../devtools/build/lib/remote/Retrier.java | 4 + .../remote/SimpleBlobStoreActionCache.java | 6 +- .../AbstractRemoteActionCacheTests.java | 11 +- .../build/lib/remote/GrpcRemoteCacheTest.java | 58 ++++++++ .../SimpleBlobStoreActionCacheTest.java | 21 --- .../build/remote/worker/RemoteWorker.java | 10 +- 9 files changed, 203 insertions(+), 103 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/remote/AbstractRemoteActionCache.java b/src/main/java/com/google/devtools/build/lib/remote/AbstractRemoteActionCache.java index 811ecc7c21b42a..edbcf6e85cbc1e 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/AbstractRemoteActionCache.java +++ b/src/main/java/com/google/devtools/build/lib/remote/AbstractRemoteActionCache.java @@ -28,7 +28,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import com.google.common.collect.Iterables; -import com.google.common.hash.HashingOutputStream; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; @@ -47,7 +46,6 @@ import com.google.devtools.build.lib.vfs.Path; import com.google.devtools.build.lib.vfs.PathFragment; import com.google.devtools.build.lib.vfs.Symlinks; -import io.grpc.Context; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; @@ -74,12 +72,10 @@ public abstract class AbstractRemoteActionCache implements AutoCloseable { protected final RemoteOptions options; protected final DigestUtil digestUtil; - private final Retrier retrier; - public AbstractRemoteActionCache(RemoteOptions options, DigestUtil digestUtil, Retrier retrier) { + public AbstractRemoteActionCache(RemoteOptions options, DigestUtil digestUtil) { this.options = options; this.digestUtil = digestUtil; - this.retrier = retrier; } /** @@ -154,23 +150,19 @@ public void onFailure(Throwable t) { */ public void download(ActionResult result, Path execRoot, FileOutErr outErr) throws ExecException, IOException, InterruptedException { - Context ctx = Context.current(); List fileDownloads = Collections.synchronizedList( new ArrayList<>(result.getOutputFilesCount() + result.getOutputDirectoriesCount())); for (OutputFile file : result.getOutputFilesList()) { Path path = execRoot.getRelative(file.getPath()); - ListenableFuture download = - retrier.executeAsync( - () -> ctx.call(() -> downloadFile(path, file.getDigest()))); + ListenableFuture download = downloadFile(path, file.getDigest()); fileDownloads.add(new FuturePathBooleanTuple(download, path, file.getIsExecutable())); } List> dirDownloads = new ArrayList<>(result.getOutputDirectoriesCount()); for (OutputDirectory dir : result.getOutputDirectoriesList()) { SettableFuture dirDownload = SettableFuture.create(); - ListenableFuture protoDownload = - retrier.executeAsync(() -> ctx.call(() -> downloadBlob(dir.getTreeDigest()))); + ListenableFuture protoDownload = downloadBlob(dir.getTreeDigest()); Futures.addCallback( protoDownload, new FutureCallback() { @@ -183,7 +175,7 @@ public void onSuccess(byte[] b) { childrenMap.put(digestUtil.compute(child), child); } Path path = execRoot.getRelative(dir.getPath()); - fileDownloads.addAll(downloadDirectory(path, tree.getRoot(), childrenMap, ctx)); + fileDownloads.addAll(downloadDirectory(path, tree.getRoot(), childrenMap)); dirDownload.set(null); } catch (IOException e) { dirDownload.setException(e); @@ -206,7 +198,7 @@ public void onFailure(Throwable t) { IOException downloadException = null; try { - fileDownloads.addAll(downloadOutErr(result, outErr, ctx)); + fileDownloads.addAll(downloadOutErr(result, outErr)); } catch (IOException e) { downloadException = e; } @@ -333,8 +325,7 @@ public boolean isExecutable() { * digest. */ private List downloadDirectory( - Path path, Directory dir, Map childrenMap, Context ctx) - throws IOException { + Path path, Directory dir, Map childrenMap) throws IOException { // Ensure that the directory is created here even though the directory might be empty path.createDirectoryAndParents(); @@ -347,10 +338,7 @@ private List downloadDirectory( Path childPath = path.getRelative(child.getName()); downloads.add( new FuturePathBooleanTuple( - retrier.executeAsync( - () -> ctx.call(() -> downloadFile(childPath, child.getDigest()))), - childPath, - child.getIsExecutable())); + downloadFile(childPath, child.getDigest()), childPath, child.getIsExecutable())); } for (DirectoryNode child : dir.getDirectoriesList()) { @@ -367,7 +355,7 @@ private List downloadDirectory( + childDigest + "not found"); } - downloads.addAll(downloadDirectory(childPath, childDir, childrenMap, ctx)); + downloads.addAll(downloadDirectory(childPath, childDir, childrenMap)); } return downloads; @@ -414,8 +402,8 @@ public void onFailure(Throwable t) { return outerF; } - private List downloadOutErr( - ActionResult result, FileOutErr outErr, Context ctx) throws IOException { + private List downloadOutErr(ActionResult result, FileOutErr outErr) + throws IOException { List downloads = new ArrayList<>(); if (!result.getStdoutRaw().isEmpty()) { result.getStdoutRaw().writeTo(outErr.getOutputStream()); @@ -423,12 +411,7 @@ private List downloadOutErr( } else if (result.hasStdoutDigest()) { downloads.add( new FuturePathBooleanTuple( - retrier.executeAsync( - () -> - ctx.call( - () -> downloadBlob(result.getStdoutDigest(), outErr.getOutputStream()))), - null, - false)); + downloadBlob(result.getStdoutDigest(), outErr.getOutputStream()), null, false)); } if (!result.getStderrRaw().isEmpty()) { result.getStderrRaw().writeTo(outErr.getErrorStream()); @@ -436,12 +419,7 @@ private List downloadOutErr( } else if (result.hasStderrDigest()) { downloads.add( new FuturePathBooleanTuple( - retrier.executeAsync( - () -> - ctx.call( - () -> downloadBlob(result.getStderrDigest(), outErr.getErrorStream()))), - null, - false)); + downloadBlob(result.getStderrDigest(), outErr.getErrorStream()), null, false)); } return downloads; } @@ -675,13 +653,11 @@ private void illegalOutput(Path what) throws ExecException, IOException { } } - protected void verifyContents(Digest expected, HashingOutputStream actual) throws IOException { - String expectedHash = expected.getHash(); - String actualHash = DigestUtil.hashCodeToString(actual.hash()); + protected void verifyContents(String expectedHash, String actualHash) throws IOException { if (!expectedHash.equals(actualHash)) { String msg = String.format( - "Download an output failed, because the expected hash" + "An output download failed, because the expected hash" + "'%s' did not match the received hash '%s'.", expectedHash, actualHash); throw new IOException(msg); diff --git a/src/main/java/com/google/devtools/build/lib/remote/GrpcRemoteCache.java b/src/main/java/com/google/devtools/build/lib/remote/GrpcRemoteCache.java index 61358cffb7078d..06af603f82991f 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/GrpcRemoteCache.java +++ b/src/main/java/com/google/devtools/build/lib/remote/GrpcRemoteCache.java @@ -39,19 +39,24 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; +import com.google.common.hash.HashCode; import com.google.common.hash.HashingOutputStream; +import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; +import com.google.common.util.concurrent.MoreExecutors; import com.google.common.util.concurrent.SettableFuture; import com.google.devtools.build.lib.actions.ActionInput; import com.google.devtools.build.lib.actions.ExecException; import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe; +import com.google.devtools.build.lib.remote.Retrier.Backoff; import com.google.devtools.build.lib.remote.merkletree.MerkleTree; import com.google.devtools.build.lib.remote.util.DigestUtil; import com.google.devtools.build.lib.remote.util.DigestUtil.ActionKey; import com.google.devtools.build.lib.remote.util.TracingMetadataUtils; import com.google.devtools.build.lib.util.io.FileOutErr; import com.google.devtools.build.lib.vfs.Path; +import com.google.protobuf.ByteString; import com.google.protobuf.Message; import io.grpc.CallCredentials; import io.grpc.Context; @@ -67,6 +72,8 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicLong; +import java.util.function.Supplier; import javax.annotation.Nullable; /** A RemoteActionCache implementation that uses gRPC calls to a remote cache server. */ @@ -88,7 +95,7 @@ public GrpcRemoteCache( RemoteRetrier retrier, DigestUtil digestUtil, ByteStreamUploader uploader) { - super(options, digestUtil, retrier); + super(options, digestUtil); this.credentials = credentials; this.channel = channel; this.retrier = retrier; @@ -248,50 +255,146 @@ protected ListenableFuture downloadBlob(Digest digest, OutputStream out) { } resourceName += "blobs/" + digestUtil.toString(digest); - @Nullable - HashingOutputStream hashOut = - options.remoteVerifyDownloads ? digestUtil.newHashingOutputStream(out) : null; + @Nullable Supplier hashSupplier = null; + if (options.remoteVerifyDownloads) { + HashingOutputStream hashOut = digestUtil.newHashingOutputStream(out); + hashSupplier = hashOut::hash; + out = hashOut; + } + SettableFuture outerF = SettableFuture.create(); + Futures.addCallback( + downloadBlob(resourceName, digest, out, hashSupplier), + new FutureCallback() { + @Override + public void onSuccess(Void result) { + outerF.set(null); + } + + @Override + public void onFailure(Throwable t) { + outerF.setException(t); + } + }, + Context.current().fixedContextExecutor(MoreExecutors.directExecutor())); + return outerF; + } + + private ListenableFuture downloadBlob( + String resourceName, + Digest digest, + OutputStream out, + @Nullable Supplier hashSupplier) { + Context ctx = Context.current(); + AtomicLong offset = new AtomicLong(0); + ProgressiveBackoff progressiveBackoff = new ProgressiveBackoff(retrier::newBackoff); + return retrier.executeAsync( + () -> + ctx.call( + () -> + requestRead( + resourceName, offset, progressiveBackoff, digest, out, hashSupplier))); + } + + static class ProgressiveBackoff implements Backoff { + private final Supplier backoffSupplier; + private Backoff currentBackoff = null; + private int retries = 0; + + /** + * Creates a resettable Backoff for progressive reads. After a reset, the nextDelay returned + * indicates an immediate retry. Initially and after indicating an immediate retry, a delegate + * is generated to provide nextDelay until reset. + * + * @param backoffSupplier Delegate Backoff generator + */ + ProgressiveBackoff(Supplier backoffSupplier) { + this.backoffSupplier = backoffSupplier; + currentBackoff = backoffSupplier.get(); + } + + public void reset() { + if (currentBackoff != null) { + retries += currentBackoff.getRetryAttempts(); + } + currentBackoff = null; + } + + @Override + public long nextDelayMillis() { + if (currentBackoff == null) { + currentBackoff = backoffSupplier.get(); + retries++; + return 0; + } + return currentBackoff.nextDelayMillis(); + } + + @Override + public int getRetryAttempts() { + int retryAttempts = retries; + if (currentBackoff != null) { + retryAttempts += currentBackoff.getRetryAttempts(); + } + return retryAttempts; + } + } + + private ListenableFuture requestRead( + String resourceName, + AtomicLong offset, + ProgressiveBackoff progressiveBackoff, + Digest digest, + OutputStream out, + @Nullable Supplier hashSupplier) { + SettableFuture future = SettableFuture.create(); bsAsyncStub() .read( - ReadRequest.newBuilder().setResourceName(resourceName).build(), + ReadRequest.newBuilder() + .setResourceName(resourceName) + .setReadOffset(offset.get()) + .build(), new StreamObserver() { @Override public void onNext(ReadResponse readResponse) { + ByteString data = readResponse.getData(); try { - readResponse.getData().writeTo(hashOut != null ? hashOut : out); + data.writeTo(out); + offset.addAndGet(data.size()); } catch (IOException e) { - outerF.setException(e); + future.setException(e); // Cancel the call. throw new RuntimeException(e); } + // reset the stall backoff because we've made progress or been kept alive + progressiveBackoff.reset(); } @Override public void onError(Throwable t) { - if (t instanceof StatusRuntimeException - && ((StatusRuntimeException) t).getStatus().getCode() - == Status.NOT_FOUND.getCode()) { - outerF.setException(new CacheNotFoundException(digest, digestUtil)); + Status status = Status.fromThrowable(t); + if (status.getCode() == Status.Code.NOT_FOUND) { + future.setException(new CacheNotFoundException(digest, digestUtil)); } else { - outerF.setException(t); + future.setException(t); } } @Override public void onCompleted() { try { - if (hashOut != null) { - verifyContents(digest, hashOut); + if (hashSupplier != null) { + verifyContents( + digest.getHash(), DigestUtil.hashCodeToString(hashSupplier.get())); } out.flush(); - outerF.set(null); + future.set(null); } catch (IOException e) { - outerF.setException(e); + future.setException(e); } } }); - return outerF; + return future; } @Override diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java index 1207585c5c36d8..92eff2f3fe4d92 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java +++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteModule.java @@ -243,12 +243,6 @@ public void beforeCommand(CommandEnvironment env) throws AbruptExitException { } if (enableBlobStoreCache) { - Retrier retrier = - new Retrier( - () -> Retrier.RETRIES_DISABLED, - (e) -> false, - retryScheduler, - Retrier.ALLOW_ALL_CALLS); executeRetrier = null; cache = new SimpleBlobStoreActionCache( @@ -257,7 +251,6 @@ public void beforeCommand(CommandEnvironment env) throws AbruptExitException { remoteOptions, GoogleAuthUtils.newCredentials(authAndTlsOptions), env.getWorkingDirectory()), - retrier, digestUtil); } diff --git a/src/main/java/com/google/devtools/build/lib/remote/Retrier.java b/src/main/java/com/google/devtools/build/lib/remote/Retrier.java index fd2f14d279a1f8..b3ccedb624cad3 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/Retrier.java +++ b/src/main/java/com/google/devtools/build/lib/remote/Retrier.java @@ -204,6 +204,10 @@ public Retrier( this.sleeper = sleeper; } + ListeningScheduledExecutorService getRetryService() { + return retryService; + } + /** * Execute a {@link Callable}, retrying execution in case of failure and returning the result in * case of success. diff --git a/src/main/java/com/google/devtools/build/lib/remote/SimpleBlobStoreActionCache.java b/src/main/java/com/google/devtools/build/lib/remote/SimpleBlobStoreActionCache.java index dea17a2e31533f..fc03bf62c73e07 100644 --- a/src/main/java/com/google/devtools/build/lib/remote/SimpleBlobStoreActionCache.java +++ b/src/main/java/com/google/devtools/build/lib/remote/SimpleBlobStoreActionCache.java @@ -62,8 +62,8 @@ public final class SimpleBlobStoreActionCache extends AbstractRemoteActionCache private final ConcurrentHashMap storedBlobs; public SimpleBlobStoreActionCache( - RemoteOptions options, SimpleBlobStore blobStore, Retrier retrier, DigestUtil digestUtil) { - super(options, digestUtil, retrier); + RemoteOptions options, SimpleBlobStore blobStore, DigestUtil digestUtil) { + super(options, digestUtil); this.blobStore = blobStore; this.storedBlobs = new ConcurrentHashMap<>(); } @@ -235,7 +235,7 @@ public void onSuccess(Boolean found) { if (found) { try { if (hashOut != null) { - verifyContents(digest, hashOut); + verifyContents(digest.getHash(), DigestUtil.hashCodeToString(hashOut.hash())); } out.flush(); outerF.set(null); diff --git a/src/test/java/com/google/devtools/build/lib/remote/AbstractRemoteActionCacheTests.java b/src/test/java/com/google/devtools/build/lib/remote/AbstractRemoteActionCacheTests.java index 1a73b4a0d2e06b..cffdce3272c1b7 100644 --- a/src/test/java/com/google/devtools/build/lib/remote/AbstractRemoteActionCacheTests.java +++ b/src/test/java/com/google/devtools/build/lib/remote/AbstractRemoteActionCacheTests.java @@ -38,10 +38,8 @@ import com.google.devtools.build.lib.actions.ExecException; import com.google.devtools.build.lib.clock.JavaClock; import com.google.devtools.build.lib.remote.AbstractRemoteActionCache.UploadManifest; -import com.google.devtools.build.lib.remote.RemoteRetrier.ExponentialBackoff; import com.google.devtools.build.lib.remote.util.DigestUtil; import com.google.devtools.build.lib.remote.util.DigestUtil.ActionKey; -import com.google.devtools.build.lib.remote.util.TestUtils; import com.google.devtools.build.lib.remote.util.Utils; import com.google.devtools.build.lib.util.io.FileOutErr; import com.google.devtools.build.lib.vfs.DigestHashFunction; @@ -671,10 +669,7 @@ public void onErrorWaitForRemainingDownloadsToComplete() throws Exception { private DefaultRemoteActionCache newTestCache() { RemoteOptions options = Options.getDefaults(RemoteOptions.class); - RemoteRetrier retrier = - TestUtils.newRemoteRetrier( - () -> new ExponentialBackoff(options), (e) -> false, retryService); - return new DefaultRemoteActionCache(options, digestUtil, retrier); + return new DefaultRemoteActionCache(options, digestUtil); } private static class DefaultRemoteActionCache extends AbstractRemoteActionCache { @@ -684,8 +679,8 @@ private static class DefaultRemoteActionCache extends AbstractRemoteActionCache AtomicInteger numSuccess = new AtomicInteger(); AtomicInteger numFailures = new AtomicInteger(); - public DefaultRemoteActionCache(RemoteOptions options, DigestUtil digestUtil, Retrier retrier) { - super(options, digestUtil, retrier); + public DefaultRemoteActionCache(RemoteOptions options, DigestUtil digestUtil) { + super(options, digestUtil); } public Digest addContents(String txt) throws UnsupportedEncodingException { diff --git a/src/test/java/com/google/devtools/build/lib/remote/GrpcRemoteCacheTest.java b/src/test/java/com/google/devtools/build/lib/remote/GrpcRemoteCacheTest.java index aebe26cce24f29..4ca2993ec4e314 100644 --- a/src/test/java/com/google/devtools/build/lib/remote/GrpcRemoteCacheTest.java +++ b/src/test/java/com/google/devtools/build/lib/remote/GrpcRemoteCacheTest.java @@ -961,4 +961,62 @@ public void getActionResult( }); assertThat(client.getCachedActionResult(actionKey)).isNull(); } + + @Test + public void downloadBlobIsRetriedWithProgress() throws IOException, InterruptedException { + final GrpcRemoteCache client = newClient(); + final Digest digest = DIGEST_UTIL.computeAsUtf8("abcdefg"); + serviceRegistry.addService( + new ByteStreamImplBase() { + @Override + public void read(ReadRequest request, StreamObserver responseObserver) { + assertThat(request.getResourceName().contains(digest.getHash())).isTrue(); + ByteString data = ByteString.copyFromUtf8("abcdefg"); + int off = (int) request.getReadOffset(); + if (off == 0) { + data = data.substring(0, 1); + } else { + data = data.substring(off); + } + responseObserver.onNext(ReadResponse.newBuilder().setData(data).build()); + if (off == 0) { + responseObserver.onError(Status.DEADLINE_EXCEEDED.asException()); + } else { + responseObserver.onCompleted(); + } + } + }); + assertThat(new String(getFromFuture(client.downloadBlob(digest)), UTF_8)).isEqualTo("abcdefg"); + } + + @Test + public void downloadBlobPassesThroughDeadlineExceededWithoutProgress() + throws IOException, InterruptedException { + final GrpcRemoteCache client = newClient(); + final Digest digest = DIGEST_UTIL.computeAsUtf8("abcdefg"); + serviceRegistry.addService( + new ByteStreamImplBase() { + @Override + public void read(ReadRequest request, StreamObserver responseObserver) { + assertThat(request.getResourceName().contains(digest.getHash())).isTrue(); + ByteString data = ByteString.copyFromUtf8("abcdefg"); + if (request.getReadOffset() == 0) { + responseObserver.onNext( + ReadResponse.newBuilder().setData(data.substring(0, 2)).build()); + } + responseObserver.onError(Status.DEADLINE_EXCEEDED.asException()); + } + }); + boolean passedThroughDeadlineExceeded = false; + try { + getFromFuture(client.downloadBlob(digest)); + } catch (RuntimeException e) { + Status st = Status.fromThrowable(e); + if (st.getCode() != Status.Code.DEADLINE_EXCEEDED) { + throw e; + } + passedThroughDeadlineExceeded = true; + } + assertThat(passedThroughDeadlineExceeded).isTrue(); + } } diff --git a/src/test/java/com/google/devtools/build/lib/remote/SimpleBlobStoreActionCacheTest.java b/src/test/java/com/google/devtools/build/lib/remote/SimpleBlobStoreActionCacheTest.java index cdafa35b12beda..7b4eaa01e4d132 100644 --- a/src/test/java/com/google/devtools/build/lib/remote/SimpleBlobStoreActionCacheTest.java +++ b/src/test/java/com/google/devtools/build/lib/remote/SimpleBlobStoreActionCacheTest.java @@ -32,7 +32,6 @@ import com.google.common.util.concurrent.MoreExecutors; import com.google.devtools.build.lib.actions.ActionInputHelper; import com.google.devtools.build.lib.clock.JavaClock; -import com.google.devtools.build.lib.remote.Retrier.Backoff; import com.google.devtools.build.lib.remote.blobstore.ConcurrentMapBlobStore; import com.google.devtools.build.lib.remote.util.DigestUtil; import com.google.devtools.build.lib.remote.util.DigestUtil.ActionKey; @@ -67,7 +66,6 @@ public class SimpleBlobStoreActionCacheTest { private FakeActionInputFileCache fakeFileCache; private Context withEmptyMetadata; private Context prevContext; - private Retrier retrier; private static ListeningScheduledExecutorService retryService; @@ -83,24 +81,6 @@ public final void setUp() throws Exception { execRoot = fs.getPath("/exec/root"); FileSystemUtils.createDirectoryAndParents(execRoot); fakeFileCache = new FakeActionInputFileCache(execRoot); - retrier = - new Retrier( - () -> - new Backoff() { - @Override - public long nextDelayMillis() { - return -1; - } - - @Override - public int getRetryAttempts() { - return 0; - } - }, - (e) -> false, - retryService, - RemoteRetrier.ALLOW_ALL_CALLS, - (millis) -> {}); Path stdout = fs.getPath("/tmp/stdout"); Path stderr = fs.getPath("/tmp/stderr"); FileSystemUtils.createDirectoryAndParents(stdout.getParentDirectory()); @@ -129,7 +109,6 @@ private SimpleBlobStoreActionCache newClient(ConcurrentMap map) return new SimpleBlobStoreActionCache( Options.getDefaults(RemoteOptions.class), new ConcurrentMapBlobStore(map), - retrier, DIGEST_UTIL); } diff --git a/src/tools/remote/src/main/java/com/google/devtools/build/remote/worker/RemoteWorker.java b/src/tools/remote/src/main/java/com/google/devtools/build/remote/worker/RemoteWorker.java index e0cdf9c42ac11c..b30aee333fa08c 100644 --- a/src/tools/remote/src/main/java/com/google/devtools/build/remote/worker/RemoteWorker.java +++ b/src/tools/remote/src/main/java/com/google/devtools/build/remote/worker/RemoteWorker.java @@ -32,8 +32,6 @@ import com.google.common.util.concurrent.ListeningScheduledExecutorService; import com.google.common.util.concurrent.MoreExecutors; import com.google.devtools.build.lib.remote.RemoteOptions; -import com.google.devtools.build.lib.remote.RemoteRetrier; -import com.google.devtools.build.lib.remote.Retrier; import com.google.devtools.build.lib.remote.SimpleBlobStoreActionCache; import com.google.devtools.build.lib.remote.SimpleBlobStoreFactory; import com.google.devtools.build.lib.remote.blobstore.ConcurrentMapBlobStore; @@ -260,18 +258,12 @@ public static void main(String[] args) throws Exception { ListeningScheduledExecutorService retryService = MoreExecutors.listeningDecorator(Executors.newScheduledThreadPool(1)); - RemoteRetrier retrier = - new RemoteRetrier( - remoteOptions, - RemoteRetrier.RETRIABLE_GRPC_ERRORS, - retryService, - Retrier.ALLOW_ALL_CALLS); DigestUtil digestUtil = new DigestUtil(fs.getDigestFunction()); RemoteWorker worker = new RemoteWorker( fs, remoteWorkerOptions, - new SimpleBlobStoreActionCache(remoteOptions, blobStore, retrier, digestUtil), + new SimpleBlobStoreActionCache(remoteOptions, blobStore, digestUtil), sandboxPath, digestUtil);