Don't display remote exec failed message on interrupt. Fixes #4783

TESTED=manually
RELNOTES: None
PiperOrigin-RevId: 188079436
diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java
index 0d11383..fc27127 100644
--- a/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java
+++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnRunner.java
@@ -233,6 +233,11 @@
       boolean uploadLocalResults,
       IOException cause)
       throws ExecException, InterruptedException, IOException {
+    // Regardless of cause, if we are interrupted, we should stop without displaying a user-visible
+    // failure/stack trace.
+    if (Thread.currentThread().isInterrupted()) {
+      throw new InterruptedException();
+    }
     if (options.remoteLocalFallback && !(cause instanceof TimeoutException)) {
       return execLocally(spawn, policy, inputMap, uploadLocalResults, remoteCache, actionKey);
     }