Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

confusing error message 'network timeout' if retryMaxDuration is hit #81

Open
alexkli opened this issue Apr 23, 2022 · 0 comments
Open
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@alexkli
Copy link
Contributor

alexkli commented Apr 23, 2022

Observed behavior

If retryMaxDuration is reached, you get this error thrown (code here):

FetchError: network timeout at https://example.com/some/url
    at wrappedFetch (/some/filesystem/folder/myproject/node_modules/@adobe/node-fetch-retry/index.js:245:20)
    at runMicrotasks (<anonymous>)
    at runNextTicks (node:internal/process/task_queues:61:5)
    at processTimers (node:internal/timers:497:9) {
  type: 'request-timeout'
}

This is confusing, because:

  1. it's not directly a network timeout
  2. it does not mention the time that has passed (and the retryMaxDuration)
  3. and it misses the original/last error message of the actual request (in my case I am sure there must have been any since retryMaxDuration was 60 sec, and socketTimeout 30 sec)

Expected behavior

Change error message to something like this:

FetchError: retries reached max duration of 60 sec for https://example.com/some/url, last error: ECONNRESET

More details

What's also interesting is that before that error I ONLY see maximum of 1 retry attempt before, with short initial retry delay:

AbortError failed with type: aborted; message: The user aborted a request.
Retrying in 107 milliseconds, attempt 1 error: AbortError, The user aborted a request.
AbortError failed with type: aborted; message: The user aborted a request.
Retrying in 182 milliseconds, attempt 1 error: AbortError, The user aborted a request.

I would have expected to see something like Retrying in 30000 milliseconds, attempt 5 or similar before running into the retryMaxDuration limit.

There are many of those messages in the log output as my application makes many requests at the same time which all ran into some network limits at around the same time. They all have just log 1 retry attempt and then presumably work fine, except the one that failed.

@alexkli alexkli added the enhancement New feature or request label Apr 23, 2022
@alexkli alexkli added this to the v3 milestone Apr 28, 2022
@alexkli alexkli self-assigned this Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant