From 301e1f3b283cbfb5af83bb0df7722f570ddcf599 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Wed, 31 Jul 2024 09:11:28 -0400 Subject: [PATCH] `RemovedNodeListener.cancelOwnerExecution` can be noisy --- .../workflow/support/steps/ExecutorStepExecution.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/jenkinsci/plugins/workflow/support/steps/ExecutorStepExecution.java b/src/main/java/org/jenkinsci/plugins/workflow/support/steps/ExecutorStepExecution.java index 3afb4f61..658020cf 100644 --- a/src/main/java/org/jenkinsci/plugins/workflow/support/steps/ExecutorStepExecution.java +++ b/src/main/java/org/jenkinsci/plugins/workflow/support/steps/ExecutorStepExecution.java @@ -379,7 +379,7 @@ private static void cancelOwnerExecution(Node node, CauseOfInterruption... cause try { listener = task.context.get(TaskListener.class); } catch (Exception x) { - LOGGER.log(Level.WARNING, null, x); + LOGGER.log(Level.FINE, x, () -> task.getFullDisplayName() + " possibly already finished"); continue; } task.withExecution(execution -> { @@ -389,11 +389,7 @@ private static void cancelOwnerExecution(Node node, CauseOfInterruption... cause return; } listener.getLogger().println("Agent " + node.getNodeName() + " was deleted; cancelling node body"); - if (Util.isOverridden(BodyExecution.class, body.getClass(), "cancel", Throwable.class)) { - body.cancel(new FlowInterruptedException(Result.ABORTED, false, causes)); - } else { // TODO remove once https://github.com/jenkinsci/workflow-cps-plugin/pull/570 is widely deployed - body.cancel(causes); - } + body.cancel(new FlowInterruptedException(Result.ABORTED, false, causes)); }); } }