jesec / flood

A modern web UI for various torrent clients with a Node.js backend and React frontend.
https://flood.js.org
GNU General Public License v3.0
2.24k stars 135 forks source link

bug: lots of torrents in Deluge may cause Flood to crash when communicating with the Daemon #788

Closed shamelin closed 3 months ago

shamelin commented 3 months ago

Type: Bug Report

Your Environment

I am running Deluge with the most recent release of the Docker container version

Summary

Hello,

First of all, thanks for the development of this tool.

I have noticed an issue when I have a lot of torrents accumulated in my Deluge environment. Whenever I have a lot of active/pending/queued (its status does not change the behavior), Flood will crash with the following error:

Node.js v22.1.0
Flood server 4.8.2 starting on http://0.0.0.0:3001

node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by                       rejecting a promise which was not handled with .catch(). The promise rejected with the reason "undefined".] {

Flood will then bootloop, without ever being able to start it's webserver.

Expected Behavior

Flood does not crash on bootup, regardless of the amount of torrents accumulated in the remote torrent client.

Current Behavior

Flood crashes at startup and goes into a bootloop.

Possible Solution

I have debugged the situation and created a pull request to fix the issue. The pull request is #787.

Steps to Reproduce

I currently have 588 torrents present in my Deluge environment and can reproduce the issue. It's not the minimal value needed to crash the software (it's less than that), but I unfortunately don't have an exact amount.

  1. Have lots of torrents present in Deluge
  2. Start the Flood software. If it's not connected to Deluge, it won't crash
  3. Configure Flood to connect to Deluge
  4. As soon as it's connected, Flood will boot loop.

Context

I want to use Flood instead of the default Deluge interface as it's more convivial. It's not user-friendly to always have to delete torrents to be able to start the interface. This issue + PR aims to fix the issue and hopefully solve the same issue for others :)

Thanks!