mikabytes / gearbox

8 stars 0 forks source link

Improve handling of non-connectable clients at startup and during operation #35

Open adia opened 2 months ago

adia commented 2 months ago

If Gearbox can't contact one of the clients at startup, it doesn't continue and shuts down immediately:

node:internal/deps/undici/undici:12606
    Error.captureStackTrace(err, this);
          ^
TypeError: fetch failed
    at node:internal/deps/undici/undici:12606:11
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async request (file:///home/adia/gearbox/server/clients/transmission/Requester.js:22:22)
    at async reloadAll (file:///home/adia/gearbox/server/clients/transmission/index.js:108:9)
    at async Transmission (file:///home/adia/gearbox/server/clients/transmission/index.js:188:3)
    at async Promise.all (index 3)
    at async file:///home/adia/gearbox/server/index.js:34:1 {
  cause: ConnectTimeoutError: Connect Timeout Error
      at onConnectTimeout (node:internal/deps/undici/undici:7760:28)
      at node:internal/deps/undici/undici:7716:50
      at Immediate._onImmediate (node:internal/deps/undici/undici:7748:13)
      at process.processImmediate (node:internal/timers:476:21) {
    code: 'UND_ERR_CONNECT_TIMEOUT'
  }
}

If it starts, and a client goes down afterwards, it does continue polling and resumes after connections are re-established, but I think this should be reflected in the UI in some way. Currently, the non-connectable client and all its torrents seem normal. Probably they should be put in an error state?

mikabytes commented 2 months ago

Thanks for the bug report. I agree on all points.

This will be needed before we can mark this project out of beta.