Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bazel cache retry on connection reset by peer #11445

Merged
merged 1 commit into from
Oct 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions nix/bazel-retry-cache.patch
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ index 57741a8f28..6673149a20 100644
workingDirectory,
diskCachePath,
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 350e1afa51..937dddd1b9 100644
index 350e1afa51..db81481b60 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
@@ -59,9 +59,11 @@ import com.google.devtools.build.lib.exec.ModuleActionContextRegistry;
Expand All @@ -90,7 +90,7 @@ index 350e1afa51..937dddd1b9 100644
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -213,7 +216,26 @@ public final class RemoteModule extends BlazeModule {
@@ -213,7 +216,31 @@ public final class RemoteModule extends BlazeModule {
remoteOptions,
creds,
Preconditions.checkNotNull(env.getWorkingDirectory(), "workingDirectory"),
Expand All @@ -104,6 +104,11 @@ index 350e1afa51..937dddd1b9 100644
+ retry = true;
+ } else if (e instanceof HttpException) {
+ retry = true;
+ } else if (e instanceof IOException) {
+ String msg = e.getMessage().toLowerCase();
+ if (msg.contains("connection reset by peer")) {
+ retry = true;
+ }
+ }
+ if (retry) {
+ System.err.println("RETRYING: " + e.toString());
Expand Down