Skip to content

Commit

Permalink
Merge pull request #369 from jglick/notifyShutdown
Browse files Browse the repository at this point in the history
Removing `FlowExecution.notifyShutdown`
  • Loading branch information
jglick authored Jan 7, 2025
2 parents 3fc3ed5 + 7352224 commit c5dc03f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,6 @@ public Iterable<BlockStartNode> 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,19 +279,9 @@ public ListenableFuture<?> apply(final Function<StepExecution, Void> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c5dc03f

Please sign in to comment.