提交 17baab54 编写于 作者: P Paul Sandoz

Fix the stopping of a matrix project build that is a one off executor.

上级 20e9ab65
......@@ -1203,6 +1203,8 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs
*/
public synchronized void doStop(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
Executor e = getExecutor();
if (e==null)
e = getOneOffExecutor();
if (e!=null)
e.doStop(req,rsp);
else
......
......@@ -406,6 +406,20 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
return null;
}
/**
* Gets the one off {@link Executor} building this job, if it's being built.
* Otherwise null.
*/
public Executor getOneOffExecutor() {
for( Computer c : Jenkins.getInstance().getComputers() ) {
for (Executor e : c.getOneOffExecutors()) {
if(e.getCurrentExecutable()==this)
return e;
}
}
return null;
}
/**
* Gets the charset in which the log file is written.
* @return never null.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册