kubernetesk8s.io/kubernetes/pkg/util/goroutinemap/exponentialbackoff Index | Files

package exponentialbackoff

import "k8s.io/kubernetes/pkg/util/goroutinemap/exponentialbackoff"

Package exponentialbackoff contains logic for implementing exponential backoff for GoRoutineMap and NestedPendingOperations.

Index

Functions

func IsExponentialBackoff

func IsExponentialBackoff(err error) bool

IsExponentialBackoff returns true if an error returned from GoroutineMap indicates that a new operation can not be started because exponentialBackOffOnError is enabled and a previous operation with the same operation failed within the durationBeforeRetry period.

func NewExponentialBackoffError

func NewExponentialBackoffError(
	operationName string, expBackoff ExponentialBackoff) error

NewExponentialBackoffError returns a new instance of ExponentialBackoff error.

Types

type ExponentialBackoff

type ExponentialBackoff struct {
	// contains filtered or unexported fields
}

ExponentialBackoff contains the last occurrence of an error and the duration that retries are not permitted.

func (*ExponentialBackoff) GenerateNoRetriesPermittedMsg

func (expBackoff *ExponentialBackoff) GenerateNoRetriesPermittedMsg(operationName string) string

func (*ExponentialBackoff) SafeToRetry

func (expBackoff *ExponentialBackoff) SafeToRetry(operationName string) error

SafeToRetry returns an error if the durationBeforeRetry period for the given lastErrorTime has not yet expired. Otherwise it returns nil.

func (*ExponentialBackoff) Update

func (expBackoff *ExponentialBackoff) Update(err *error)

Source Files

exponential_backoff.go

Version
v1.33.0 (latest)
Published
Apr 23, 2025
Platform
linux/amd64
Imports
2 packages
Last checked
3 hours ago

Tools for package owners.