From bf955430cb58987bbbe3cd2925ea06700cf85609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Fei?= Date: Thu, 9 Jul 2026 10:36:09 +0200 Subject: [PATCH] fix: reduce startupProbe periodSeconds without losing failure tolerance (#992) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The startup probe for the injected plugin-barman-cloud sidecar previously left `periodSeconds` unset, so the API server defaulted it to 10s. Because the sidecar is a native init container that gates the main postgres container on reaching `Started`, this added roughly one full period to every pod's startup, even though the probe itself (a local unix-socket health check) normally succeeds in milliseconds. `periodSeconds` is now 1s, so the probe reports success almost immediately in the common case. To avoid trading away failure tolerance for that faster common case, `failureThreshold` is raised to 30 and `timeoutSeconds` is lowered to 5s: a unix-socket call essentially never times out under mere load, so hitting the timeout means the sidecar is genuinely unresponsive rather than just slow, and it's fine to give that rare case more attempts before restarting the container. Closes #991 Signed-off-by: Niccolò Fei Signed-off-by: Marco Nenciarini Co-authored-by: Marco Nenciarini --- internal/cnpgi/operator/lifecycle.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/cnpgi/operator/lifecycle.go b/internal/cnpgi/operator/lifecycle.go index 776b301..8bb26d8 100644 --- a/internal/cnpgi/operator/lifecycle.go +++ b/internal/cnpgi/operator/lifecycle.go @@ -403,8 +403,9 @@ func reconcilePodSpec( envs = append(envs, config.env...) baseProbe := &corev1.Probe{ - FailureThreshold: 10, - TimeoutSeconds: 10, + PeriodSeconds: 1, + FailureThreshold: 30, + TimeoutSeconds: 5, ProbeHandler: corev1.ProbeHandler{ Exec: &corev1.ExecAction{ Command: []string{"/manager", "healthcheck", "unix"},