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

Bug report and a potential solution: ECONNRESET error #113

Open
cocktailpeanut opened this issue Jan 3, 2024 · 0 comments
Open

Bug report and a potential solution: ECONNRESET error #113

cocktailpeanut opened this issue Jan 3, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@cocktailpeanut
Copy link

Been trying to debug why I'm getting ECONNRESET errors occasionally.

What I found was the following:

1 .The ECONNRESET error doesn't always result in dl.start() throwing. Often this results in the downloader retrying the request.
2. But sometimes it just halts with ECONNRESET.
3. When it halts with ECONNRESET, I've found that it doesn't even get to the redirect step (The URL i'm fetching involves a redirect).

Based on this, I've come to a conclusion that the ECONNRESET is happening at the HEAD step inside the getTotalSize(). It triggers the "error" event here: https://github.com/hgouveia/node-downloader-helper/blob/master/src/index.js#L365

Basically, I think this specific case of ECONNRESET is happening during the HEAD step and there is no handling logic to retry.

My current solution is to just retry the dl.start() multiple times until it eventually works. But I feel like this should be handled by the library, perhaps take a separate retryHead attribute that does the same thing as retry, but for the getTotalSize() request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants