From f16ac1dfd0625b58453c1aca68ffa76c516ebd8e Mon Sep 17 00:00:00 2001 From: subhamkrai Date: Thu, 16 Jun 2022 18:13:44 +0530 Subject: [PATCH] core: increase liveness probe timeout to 2s we have noticed multiple failures because of the probe failing, most of the time it's due to fewer resources. But increasing timeout fixes that, so increasing the probe timeout to 2s from default 1s so that it will give more time to probe before failing. Signed-off-by: subhamkrai (cherry picked from commit 62f0fb2b1d6d130d3019472036c4e164ce50a0a2) --- pkg/operator/ceph/controller/spec.go | 2 ++ pkg/operator/ceph/controller/spec_test.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/pkg/operator/ceph/controller/spec.go b/pkg/operator/ceph/controller/spec.go index feb02d729..d11ada868 100644 --- a/pkg/operator/ceph/controller/spec.go +++ b/pkg/operator/ceph/controller/spec.go @@ -53,6 +53,7 @@ const ( daemonTypeLabel = "ceph_daemon_type" ExternalMgrAppName = "rook-ceph-mgr-external" ServiceExternalMetricName = "http-external-metrics" + livenessProbeTimeoutSeconds int32 = 2 livenessProbeInitialDelaySeconds int32 = 10 startupProbeFailuresDaemonDefault int32 = 6 // multiply by 10 = effective startup timeout // The OSD requires a long timeout in case the OSD is taking extra time to @@ -583,6 +584,7 @@ func GenerateLivenessProbeExecDaemon(daemonType, daemonID string) *v1.Probe { }, }, InitialDelaySeconds: livenessProbeInitialDelaySeconds, + TimeoutSeconds: livenessProbeTimeoutSeconds, } } diff --git a/pkg/operator/ceph/controller/spec_test.go b/pkg/operator/ceph/controller/spec_test.go index 0dee5c7f7..ffbcdf41e 100644 --- a/pkg/operator/ceph/controller/spec_test.go +++ b/pkg/operator/ceph/controller/spec_test.go @@ -159,10 +159,12 @@ func TestGenerateLivenessProbeExecDaemon(t *testing.T) { assert.Equal(t, expectedCommand, probe.ProbeHandler.Exec.Command) assert.Equal(t, livenessProbeInitialDelaySeconds, probe.InitialDelaySeconds) + assert.Equal(t, livenessProbeTimeoutSeconds, probe.TimeoutSeconds) // test with a mon so the delay should be 10 probe = GenerateLivenessProbeExecDaemon(config.MonType, "a") assert.Equal(t, livenessProbeInitialDelaySeconds, probe.InitialDelaySeconds) + assert.Equal(t, livenessProbeTimeoutSeconds, probe.TimeoutSeconds) } func TestDaemonFlags(t *testing.T) {