node-downloader-helper: Downloads "freezing" for no obvious reason?
Iāve now experienced multiple times that while downloading a file, once in a while a download will just freeze and not continue to download. It doesnāt fail, throws no error, doesnāt change state, it just stops downloading. The dl object either stops emitting progress events or always reports the same stat, downloaded, progress, speed all stay the same.
In my application I have 5 download āslotsā and if I download many files, those slots keep freezing on after the other, until every slot is filled with a frozen download and nothing gets downloaded anymore.
From my experience the downloads will stay frozen indefinitely, until I manually pause and then resume them (that is, if the download URL is still working and resume is supported).
I have no idea why this is happening or what exactly is causing this, so I canāt tell you how to recreate the behavior. But I am pretty sure that the issue is with node-downloader-helper and not my app (the downloads really are frozen and donāt just continue downloading in the background without the stats showing up).
The download also donāt get slower before freezing (which could indicate server-side throttling), the last reported speed is similar to previous/average speeds.
Any idea why this could happen?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 27 (25 by maintainers)
Commits related to this issue
- When timeout, it will retry the download if available if not emit timeout #40 — committed to hgouveia/node-downloader-helper by hgouveia 3 years ago
- Squashed commit of the following: commit 33aab440ce6d5bf996ffec07fbadad61862811c6 Author: Jose De Gouveia <dhgouveia@gmail.com> Date: Mon Oct 4 11:12:26 2021 +0200 Incremented 1.0.19 commit a... — committed to hgouveia/node-downloader-helper by hgouveia 3 years ago
Now the behavior is that if i detect a
timeoutit will abort the request andretryif available, if not, it will fail@Chaphasilor I actually missed this in the newer version I just release and is something I wanted to add, I just forgot it hehe, so i will implement this behavior this upcoming week and release new version
Basically if the timout event is triggered from the request, I will stop the download, if retry option is enable it will retry, if not just stop and emit timeout
What you think?
for my experience is just close the connection without any message, in fact that was one of the reason i then added the total size and downloaded size into the āendā event, so users could check that and retry until finishes
here i prepared a plain https request using nodejs, you could try with this, and see if the issue persist, i also added all possible event, probably one of them could be missing in my implementation https://gist.github.com/hgouveia/f807dfcb967c9fbc63b4aa4c0ac4e49b