Skip to content

Exponential Backoff in V2 #422

@bbernays

Description

@bbernays

According to the comments in the retrier, gax is supposed to be using exponential backoff which is industry best practice

// Backoff implements exponential backoff. The wait time between retries is a

But in the actual code it seems to be a linear backoff based on the multiplier

gax-go/v2/call_option.go

Lines 197 to 200 in fef87e6

// https://www.awsarchitectureblog.com/2015/03/backoff.html argues that
// that is the best strategy.
d := time.Duration(1 + rand.Int63n(int64(bo.cur)))
bo.cur = time.Duration(float64(bo.cur) * bo.Multiplier)

Is this the intended approach or should it in fact use some kind of exponential calculation like in the linked blog post?

Metadata

Metadata

Assignees

Labels

priority: p3Desirable enhancement or fix. May not be included in next release.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions