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.
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.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#L365Basically, 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 separateretryHead
attribute that does the same thing asretry
, but for thegetTotalSize()
request.