Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing FlowExecution.notifyShutdown #369

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading