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

Add more logging on shutdown #1837

Merged
merged 1 commit into from
Oct 28, 2024
Merged
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 @@ -30,10 +30,11 @@
import io.netty.util.concurrent.EventExecutor;
import io.netty.util.concurrent.Promise;
import io.netty.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.TimeUnit;

/**
* TODO: Change this class to be an instance per-port.
* So that then the configuration can be different per-port, which is need for the combined FTL/Cloud clusters.
Expand Down Expand Up @@ -110,6 +111,7 @@ Promise<Void> gracefullyShutdownClientChannels(ShutdownType shutdownType) {
flagChannelForClose(channel, shutdownType);
}

LOG.info("Setting up scheduled task for {} with shutdownType: {}", closeFuture, shutdownType);
Promise<Void> promise = executor.newPromise();
Runnable cancelTimeoutTask;
if (shutdownType == ShutdownType.SHUTDOWN) {
Expand All @@ -129,6 +131,7 @@ Promise<Void> gracefullyShutdownClientChannels(ShutdownType shutdownType) {
TimeUnit.SECONDS);
cancelTimeoutTask = () -> {
if (!timeoutTask.isDone()) {
LOG.info("Timeout task canceled before completion.");
// close happened before the timeout
timeoutTask.cancel(false);
}
Expand All @@ -138,6 +141,7 @@ Promise<Void> gracefullyShutdownClientChannels(ShutdownType shutdownType) {
}

closeFuture.addListener(future -> {
LOG.info("CloseFuture completed successfully: {}", future.isSuccess());
cancelTimeoutTask.run();
promise.setSuccess(null);
});
Expand Down
Loading