Skip to content

Exponential backoff retry strategy #431

@CedWaro

Description

@CedWaro

Environment details

  • OS: Windows 10 Home
  • Node.js version: 10.15.3
  • npm version: 6.4.1
  • google-gax version: 0.25.6 (old version but I don't think this part has been changed)

Hello,

  1. It seems that the https://cloud.google.com/storage/docs/exponential-backoff retry strategy implementation isn't "exponential" but rather "random".

At the moment, for the setTimeout duration, I see in apiCallable.js :

const toSleep = delay * Math.random(); // [ 0 ; delay ]

instead of (maybe):

const toSleep = delay + Math.random() * 1000 // [ delay ; delay+E ]

  1. For the retries count case, instead of the "deadline" case, it seems that the timeout is undefined for the next iterations because of an invalid deadline Date:

timeout = Math.min(timeout * timeoutMult, maxTimeout, deadline - now.getTime());

Sorry if I'm wrong, thanks in advance !

Metadata

Metadata

Labels

needs more infoThis issue needs more information from the customer to proceed.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