Skip to content

Backoff policy is constant, not exponential #320

@9999years

Description

@9999years

The current backoff implementation in process-compose uses a (user-customizable) constant-time backoff with a minimum polling interval of 1 second.

However, users customizing a polling interval generally expect some form of exponential backoff in order to poll more frequently at the beginning of a process (when changes are more likely) and then less frequently as time goes on.

Go seems to have a decent backoff package by @cenkalti which exposes the following interface:

type ExponentialBackOff struct {
	InitialInterval     time.Duration
	RandomizationFactor float64
	Multiplier          float64
	MaxInterval         time.Duration
	// After MaxElapsedTime the ExponentialBackOff returns Stop.
	// It never stops if MaxElapsedTime == 0.
	MaxElapsedTime time.Duration
	Stop           time.Duration
	Clock          Clock
	// contains filtered or unexported fields
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions