提交 049b55e9 编写于 作者: K kohsuke

preventive fix for issue #1583

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@8827 71c3de6d-444a-0410-be80-ed276b4c234a
上级 6c2b0524
......@@ -4,11 +4,12 @@ import hudson.Util;
import hudson.security.ACL;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.acegisecurity.Authentication;
import org.acegisecurity.context.SecurityContextHolder;
import javax.servlet.ServletException;
import java.io.IOException;
import java.util.logging.Logger;
import java.util.logging.Level;
/**
......@@ -66,6 +67,11 @@ public class Executor extends Thread implements ModelObject {
}
try {
// clear the interrupt flag as a precaution.
// sometime an interrupt aborts a build but without clearing the flag.
// see issue #1583
Thread.interrupted();
startTime = System.currentTimeMillis();
executable = task.createExecutable();
queue.execute(executable,task);
......@@ -73,7 +79,7 @@ public class Executor extends Thread implements ModelObject {
// for some reason the executor died. this is really
// a bug in the code, but we don't want the executor to die,
// so just leave some info and go on to build other things
e.printStackTrace();
LOGGER.log(Level.SEVERE, "Executor throw an exception unexpectedly",e);
}
executable = null;
}
......@@ -195,4 +201,6 @@ public class Executor extends Thread implements ModelObject {
public static Executor currentExecutor() {
return (Executor)Thread.currentThread();
}
private static final Logger LOGGER = Logger.getLogger(Executor.class.getName());
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册