Skip to content

Commit bab64ee

Browse files
committed
Ref #27090: limit log output of retries
1 parent 4d3c8f1 commit bab64ee

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

src/main/java/eu/openanalytics/containerproxy/backend/kubernetes/KubernetesBackend.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ protected Container startContainer(ContainerSpec spec, Proxy proxy) throws Excep
300300
int totalWaitMs = Integer.parseInt(environment.getProperty("proxy.kubernetes.pod-wait-time", "60000"));
301301
boolean podReady = Retrying.retry((currentAttempt, maxAttempts) -> {
302302
if (!Readiness.getInstance().isReady(kubeClient.resource(startedPod).fromServer().get())) {
303-
if (currentAttempt > 0 && log != null) log.debug(String.format("Container not ready yet, trying again (%d/%d)", currentAttempt, maxAttempts));
303+
if (currentAttempt > 10 && log != null) log.info(String.format("Container not ready yet, trying again (%d/%d)", currentAttempt, maxAttempts));
304304
return false;
305305
}
306306
return true;
@@ -347,7 +347,7 @@ protected Container startContainer(ContainerSpec spec, Proxy proxy) throws Excep
347347
.build());
348348

349349
// Workaround: waitUntilReady appears to be buggy.
350-
Retrying.retry((currentAttempts, maxAttempts) -> isServiceReady(kubeClient.resource(startupService).fromServer().get()), 60_000);
350+
Retrying.retry((currentAttempt, maxAttempts) -> isServiceReady(kubeClient.resource(startupService).fromServer().get()), 60_000);
351351

352352
service = kubeClient.resource(startupService).fromServer().get();
353353
}

src/main/java/eu/openanalytics/containerproxy/service/ProxyStatusService.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,24 @@ public void containerStarting(Proxy proxy, Container container) {
5454
* Step 2.1: schedule container
5555
*/
5656
public void containerScheduled(Proxy proxy, Container container, LocalDateTime scheduledTime) {
57-
startupLog.get(proxy.getId()).getScheduleContainer(container.getIndex()).stepSucceeded(
58-
startupLog.get(proxy.getId()).getStartContainer(container.getIndex()).getStartTime(),
59-
scheduledTime);
57+
startupLog.get(proxy.getId())
58+
.getScheduleContainer(container.getIndex())
59+
.stepSucceeded(
60+
startupLog.get(proxy.getId()).getStartContainer(container.getIndex()).getStartTime(),
61+
scheduledTime
62+
);
6063
}
6164

6265
/**
6366
* Step 2.2: pull image
6467
*/
6568
public void imagePulled(Proxy proxy, Container container, LocalDateTime pullingTime, LocalDateTime pulledTime) {
66-
startupLog.get(proxy.getId()).getPullImage(container.getIndex()).stepSucceeded(pullingTime, pulledTime);
69+
startupLog.get(proxy.getId())
70+
.getPullImage(container.getIndex())
71+
.stepSucceeded(
72+
pullingTime,
73+
pulledTime
74+
);
6775
}
6876

6977
/**

0 commit comments

Comments
 (0)