From 0c3782bfdfc3b1a85e7b904ec7c9f79a7d9126a5 Mon Sep 17 00:00:00 2001 From: Haytham Abuelfutuh Date: Mon, 23 Sep 2024 13:36:46 -0700 Subject: [PATCH] Backoff on etcd errors (#5710) Signed-off-by: Haytham Abuelfutuh --- flytepropeller/pkg/controller/nodes/task/backoff/handler.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/flytepropeller/pkg/controller/nodes/task/backoff/handler.go b/flytepropeller/pkg/controller/nodes/task/backoff/handler.go index fc890c7a09..aadbfed514 100644 --- a/flytepropeller/pkg/controller/nodes/task/backoff/handler.go +++ b/flytepropeller/pkg/controller/nodes/task/backoff/handler.go @@ -195,8 +195,12 @@ func IsResourceQuotaExceeded(err error) bool { return apiErrors.IsForbidden(err) && strings.Contains(err.Error(), "exceeded quota") } +func IsEtcdError(err error) bool { + return apiErrors.IsForbidden(err) && strings.Contains(err.Error(), "etcdserver:") +} + func IsBackOffError(err error) bool { - return IsResourceQuotaExceeded(err) || apiErrors.IsTooManyRequests(err) || apiErrors.IsServerTimeout(err) + return IsResourceQuotaExceeded(err) || apiErrors.IsTooManyRequests(err) || apiErrors.IsServerTimeout(err) || IsEtcdError(err) } func GetComputeResourceAndQuantity(err error, resourceRegex *regexp.Regexp) v1.ResourceList {