backoff

package
v0.0.0-...-95ec5f3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 3 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backoff

type Backoff interface {
	// Backoff execution for the given node group. Returns time till execution is backed off.
	Backoff(nodeGroup cloudprovider.NodeGroup, nodeInfo *framework.NodeInfo, errorInfo cloudprovider.InstanceErrorInfo, currentTime time.Time) time.Time
	// BackoffStatus returns whether the execution is backed off for the given node group and error info when the node group is backed off.
	BackoffStatus(nodeGroup cloudprovider.NodeGroup, nodeInfo *framework.NodeInfo, currentTime time.Time) Status
	// RemoveBackoff removes backoff data for the given node group.
	RemoveBackoff(nodeGroup cloudprovider.NodeGroup, nodeInfo *framework.NodeInfo)
	// RemoveStaleBackoffData removes stale backoff data.
	RemoveStaleBackoffData(currentTime time.Time)
}

Backoff allows time-based backing off of node groups considered in scale up algorithm

func NewExponentialBackoff

func NewExponentialBackoff(
	initialBackoffDuration time.Duration,
	maxBackoffDuration time.Duration,
	backoffResetTimeout time.Duration,
	nodeGroupKey func(nodeGroup cloudprovider.NodeGroup) string) Backoff

NewExponentialBackoff creates an instance of exponential backoff.

func NewIdBasedExponentialBackoff

func NewIdBasedExponentialBackoff(initialBackoffDuration time.Duration, maxBackoffDuration time.Duration, backoffResetTimeout time.Duration) Backoff

NewIdBasedExponentialBackoff creates an instance of exponential backoff with node group Id used as a key.

type Status

type Status struct {
	IsBackedOff bool
	ErrorInfo   cloudprovider.InstanceErrorInfo
}

Status contains information about back off status.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL