提交 6e91651a 编写于 作者: K Kohsuke Kawaguchi

[JENKINS-16824] log who's interrupting executors.

This bug indicates that people are having trouble understanding who's
responsible for aborting the build. This change records that
information through the logger.
上级 74977531
......@@ -49,6 +49,7 @@ import org.kohsuke.stapler.export.Exported;
import javax.servlet.ServletException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Vector;
import java.util.logging.Logger;
......@@ -135,6 +136,9 @@ public class Executor extends Thread implements ModelObject {
* Interrupt the execution. Mark the cause and the status accordingly.
*/
public void interrupt(Result result, CauseOfInterruption... causes) {
if (LOGGER.isLoggable(FINE))
LOGGER.log(FINE, String.format("%s is interrupted(%s): %s", getDisplayName(), result, Util.join(Arrays.asList(causes),",")), new InterruptedException());
interruptStatus = result;
synchronized (this.causes) {
for (CauseOfInterruption c : causes) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册