decypharr icon indicating copy to clipboard operation
decypharr copied to clipboard

Reorder file collection and download link processing in GetFileDownlo…

Open dylanmazurek opened this issue 3 months ago • 6 comments

Fixed problem with torbox download routines causing Post-Download Action: Download to never complete.

dylanmazurek avatar Aug 29 '25 11:08 dylanmazurek

The issue #123 tagged to this PR was already closed. I don't know what this fixed and how.

The changes don't really resolve anything, really...

sirrobot01 avatar Aug 30 '25 03:08 sirrobot01

The deadlock occurs because the goroutines send to linkCh before filesCh, but the collecting loops process filesCh before linkCh. This causes goroutines to block on sending to the buffered linkCh (filling its capacity), preventing them from sending to filesCh or calling wg.Done(). The collecting loops then hang waiting for items or closure.

To fix this I reordered the collecting loops in GetFileDownloadLinks to match the send order in the goroutines: collect from linkCh first, then filesCh, then errCh. This ensures sends unblock in sequence without deadlock.

I tested with the current v1.1.3 release and the downloads get stuck and never fully download. With this re-ordering, I am able to see downloads finish and leave the list.

dylanmazurek avatar Sep 06 '25 11:09 dylanmazurek

I can concurr that this change is needed and I tested it.

jwhite avatar Oct 04 '25 08:10 jwhite

@sirrobot01 do you think this was related to the streaming issues that I was having with TorBox? I was able to stream for a bit, but then streaming stops working until I restart Decypharr.

NeurekaSoftware avatar Oct 06 '25 18:10 NeurekaSoftware

It would be nice to get this pull request in so that we can take later versions of decypharr with torbox.

jwhite avatar Oct 12 '25 09:10 jwhite

@sirrobot01 do you think this was related to the streaming issues that I was having with TorBox? I was able to stream for a bit, but then streaming stops working until I restart Decypharr.

Having this problem as well.

rocketprogrammer avatar Nov 01 '25 00:11 rocketprogrammer