diff --git a/core/src/main/java/hudson/Launcher.java b/core/src/main/java/hudson/Launcher.java index 1098f66ac5..f681cedc09 100644 --- a/core/src/main/java/hudson/Launcher.java +++ b/core/src/main/java/hudson/Launcher.java @@ -250,7 +250,11 @@ public abstract class Launcher { public Integer call() throws IOException { Proc p = new LocalLauncher(TaskListener.NULL).launch(cmd, env, in, out, workDir ==null ? null : new FilePath(new File(workDir))); - return p.join(); + try { + return p.join(); + } catch (InterruptedException e) { + return -1; + } } private static final long serialVersionUID = 1L; diff --git a/core/src/main/java/hudson/Proc.java b/core/src/main/java/hudson/Proc.java index e6f454671c..04e5e9b34e 100644 --- a/core/src/main/java/hudson/Proc.java +++ b/core/src/main/java/hudson/Proc.java @@ -32,7 +32,7 @@ public abstract class Proc { * if there's an error killing a process * and a stack trace could help the trouble-shooting. */ - public abstract void kill() throws IOException; + public abstract void kill() throws IOException, InterruptedException; /** * Waits for the completion of the process. @@ -46,7 +46,7 @@ public abstract class Proc { * if there's an error launching/joining a process * and a stack trace could help the trouble-shooting. */ - public abstract int join() throws IOException; + public abstract int join() throws IOException, InterruptedException; /** * Locally launched process. @@ -96,7 +96,7 @@ public abstract class Proc { * Waits for the completion of the process. */ @Override - public int join() { + public int join() throws InterruptedException { try { t1.join(); t2.join(); @@ -104,12 +104,12 @@ public abstract class Proc { } catch (InterruptedException e) { // aborting. kill the process proc.destroy(); - return -1; + throw e; } } @Override - public void kill() { + public void kill() throws InterruptedException { proc.destroy(); join(); } @@ -160,19 +160,19 @@ public abstract class Proc { } @Override - public void kill() throws IOException { + public void kill() throws IOException, InterruptedException { process.cancel(true); join(); } @Override - public int join() throws IOException { + public int join() throws IOException, InterruptedException { try { return process.get(); } catch (InterruptedException e) { // aborting. kill the process process.cancel(true); - return -1; + throw e; } catch (ExecutionException e) { if(e.getCause() instanceof IOException) throw (IOException)e.getCause(); diff --git a/core/src/main/java/hudson/model/AbstractBuild.java b/core/src/main/java/hudson/model/AbstractBuild.java index 4db3388813..51ea34a81c 100644 --- a/core/src/main/java/hudson/model/AbstractBuild.java +++ b/core/src/main/java/hudson/model/AbstractBuild.java @@ -134,7 +134,7 @@ public abstract class AbstractBuild
,R extends Abs
return Result.SUCCESS;
}
- private void createLastSuccessfulLink(BuildListener listener) {
+ private void createLastSuccessfulLink(BuildListener listener) throws InterruptedException {
if(!isWindows()) {
try {
// ignore a failure.
diff --git a/core/src/main/java/hudson/model/Run.java b/core/src/main/java/hudson/model/Run.java
index 6217423d1b..6ffb05ad8d 100644
--- a/core/src/main/java/hudson/model/Run.java
+++ b/core/src/main/java/hudson/model/Run.java
@@ -36,6 +36,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
+import java.util.logging.Level;
/**
* A particular execution of {@link Job}.
@@ -563,6 +564,11 @@ public abstract class Run