Skip to content

Commit

Permalink
Backoff on etcd errors (#5710)
Browse files Browse the repository at this point in the history
Signed-off-by: Haytham Abuelfutuh <[email protected]>
  • Loading branch information
EngHabu authored Sep 23, 2024
1 parent 28f65b3 commit 0c3782b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion flytepropeller/pkg/controller/nodes/task/backoff/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 0c3782b

Please sign in to comment.