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

minimizing debug logs related to the backoff interval #5080

Merged
merged 1 commit into from
Apr 27, 2023
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 @@ -17,15 +17,12 @@

import io.fabric8.kubernetes.client.Config;
import io.fabric8.kubernetes.client.RequestConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Optional;
import java.util.concurrent.atomic.AtomicInteger;

public class ExponentialBackoffIntervalCalculator {

private static final Logger logger = LoggerFactory.getLogger(ExponentialBackoffIntervalCalculator.class);
//we were using the same default in multiple places, so it has been moved here for now
private static final int MAX_RETRY_INTERVAL_EXPONENT = 5;

Expand Down Expand Up @@ -57,9 +54,7 @@ public void resetReconnectAttempts() {

public final long nextReconnectInterval() {
int exponentOfTwo = currentReconnectAttempt.getAndIncrement();
long ret = getInterval(exponentOfTwo);
logger.debug("Current reconnect backoff is {} milliseconds (T{})", ret, exponentOfTwo);
return ret;
return getInterval(exponentOfTwo);
}

public int getCurrentReconnectAttempt() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ void scheduleReconnect(WatchRequestState state) {
return;
}

logger.debug("Scheduling reconnect task");

long delay = nextReconnectInterval();

logger.debug("Scheduling reconnect task in {} ms", delay);

synchronized (this) {
reconnectAttempt = Utils.schedule(baseOperation.context.getExecutor(), this::reconnect, delay, TimeUnit.MILLISECONDS);
if (isForceClosed()) {
Expand Down