From 6e91651a574fbc38eae152c8f7dc3c0c7d42fb7b Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Thu, 25 Apr 2013 07:19:02 -0700 Subject: [PATCH] [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. --- core/src/main/java/hudson/model/Executor.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/main/java/hudson/model/Executor.java b/core/src/main/java/hudson/model/Executor.java index ee4eddec36..4fcb0968fd 100644 --- a/core/src/main/java/hudson/model/Executor.java +++ b/core/src/main/java/hudson/model/Executor.java @@ -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) { -- GitLab