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

Most upvoted comments

Hey! Sure, I’ll try it out right away, but it’s hard for me to reproduce too 😃 I’ll try my best!

What did you change? šŸ¤”

Now the behavior is that if i detect a timeout it will abort the request and retry if 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?

@hgouveia yeah, but shouldn’t there at least be an error event?

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