From 735222421e8116967fc9504a639603263b824105 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 6 Jan 2025 18:18:32 -0500 Subject: [PATCH] Removing `FlowExecution.notifyShutdown` --- .../plugins/workflow/flow/FlowExecution.java | 8 -------- .../plugins/workflow/flow/FlowExecutionList.java | 10 ---------- .../plugins/workflow/flow/FlowExecutionOwner.java | 11 ----------- 3 files changed, 29 deletions(-) diff --git a/src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecution.java b/src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecution.java index 289dd9a7..e1f8dc91 100644 --- a/src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecution.java +++ b/src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecution.java @@ -317,14 +317,6 @@ public Iterable iterateEnclosingBlocks(@NonNull FlowNode node) { return getInternalGraphLookup().iterateEnclosingBlocks(node); } - /** - * @deprecated No longer used. - */ - @Deprecated - protected void notifyShutdown() { - // Default is no-op - } - /** * Called after a restart and any attempts at {@link StepExecution#onResume} have completed. * This is a signal that it is safe to resume program execution. diff --git a/src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecutionList.java b/src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecutionList.java index a3a448cf..696f62c5 100644 --- a/src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecutionList.java +++ b/src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecutionList.java @@ -279,19 +279,9 @@ public ListenableFuture apply(final Function f) { } @Restricted(DoNotUse.class) - @SuppressWarnings("deprecation") @Terminator(requires = EXECUTIONS_SUSPENDED, attains = LIST_SAVED) public static void saveAll() throws InterruptedException { LOGGER.fine("ensuring all executions are saved"); - - for (FlowExecutionOwner owner : get().runningTasks.getView()) { - try { - owner.notifyShutdown(); - } catch (Exception ex) { - LOGGER.log(Level.WARNING, "Error shutting down task", ex); - } - } - SingleLaneExecutorService executor = get().executor; executor.shutdown(); executor.awaitTermination(1, TimeUnit.MINUTES); diff --git a/src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecutionOwner.java b/src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecutionOwner.java index 1c85716b..e4a846ef 100644 --- a/src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecutionOwner.java +++ b/src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecutionOwner.java @@ -53,17 +53,6 @@ public abstract class FlowExecutionOwner implements Serializable { @NonNull public abstract FlowExecution get() throws IOException; - /** - * @deprecated No longer used. - */ - @Deprecated - void notifyShutdown() { - FlowExecution exec = getOrNull(); - if (exec != null) { - exec.notifyShutdown(); - } - } - /** * Same as {@link #get} but avoids throwing an exception or blocking. * @return a valid flow execution, or null if not ready or invalid