Description
Describe the bug
- Node.js version: v22.7.0
- OS & version: MacOs - 14.6.1
Just to set the context....
-
I have method like...
async function getErrorCodes() {
return [
'ETIMEDOUT',
'ECONNRESET',
'EADDRINUSE',
'ECONNREFUSED',
'EPIPE',
'ENOTFOUND',
'ENETUNREACH',
'EAI_AGAIN',
'ERR_SOCKET_TIMEOUT' <-- additionally added for retries...
];
} -
i have method like...
async function exponentialBackOffDelay() {
return ({ attemptCount,retryOptions,error, computedValue,retryAfter }) => {
if (computedValue) {
let cdelay = attemptCount * 5000;
return cdelay;
}
console.log(permitted ${attemptCount} retry attempts have been completed
);
return 0;
}
async function getGotRequest() {
return got.extend({
retry: {
limit: 5
methods:['GET','PUT'],
errorCodes: await getErrorCodes(),
calculateDelay: await exponentialBackOffDelay()
},
}
We've noticed that even though the limit for all requests is set to 5.
there are some requests that only have 1 retry attempt.
permitted 1 retry attempts have been completed;
and there are some requests that only have 3 retry attempt.
permitted 3 retry attempts have been completed;
and there are some requests that only have 5 retry attempt.
permitted 5 retry attempts have been completed;
My Question
Why are my requests exhibiting varying retry attempts when the limit is set to 5 for all requests?
Could I be overlooking a detail in the exponentialBackOffDelay settings or perhaps in the timeout configurations?