diff --git a/src/main/java/com/google/devtools/build/lib/bazel/repository/DecompressorValue.java b/src/main/java/com/google/devtools/build/lib/bazel/repository/DecompressorValue.java index 98ca4b4fa7e0ee..134f1a0e37cb60 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/repository/DecompressorValue.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/DecompressorValue.java @@ -24,6 +24,7 @@ import com.google.devtools.build.skyframe.SkyFunctionException.Transience; import com.google.devtools.build.skyframe.SkyValue; import java.io.IOException; +import java.nio.channels.ClosedByInterruptException; import java.util.Optional; import java.util.Set; import net.starlark.java.eval.Starlark; @@ -128,6 +129,8 @@ public static Path decompress(DecompressorDescriptor descriptor) throws RepositoryFunctionException, InterruptedException { try { return getDecompressor(descriptor.archivePath()).decompress(descriptor); + } catch (ClosedByInterruptException e) { + throw new InterruptedException(); } catch (IOException e) { Path destinationDirectory = descriptor.archivePath().getParentDirectory(); throw new RepositoryFunctionException( diff --git a/src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkBaseExternalContext.java b/src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkBaseExternalContext.java index e9b641086aa33d..f34fb44603f63d 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkBaseExternalContext.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkBaseExternalContext.java @@ -494,9 +494,6 @@ public StructImpl download( if (executable) { outputPath.getPath().setExecutable(true); } - } catch (InterruptedException e) { - throw new RepositoryFunctionException( - new IOException("thread interrupted"), Transience.TRANSIENT); } catch (IOException e) { if (allowFail) { return StarlarkInfo.create( @@ -692,10 +689,6 @@ public StructImpl downloadAndExtract( env.getListener(), envVariables, getIdentifyingStringForLogging()); - } catch (InterruptedException e) { - env.getListener().post(w); - throw new RepositoryFunctionException( - new IOException("thread interrupted"), Transience.TRANSIENT); } catch (IOException e) { env.getListener().post(w); if (allowFail) {