fix(download): retry transfers whose local download failed
Nothing ever removed a TransferContext from the coordinator, and the
'already being processed' check treated any tracked transfer as in flight.
One permanent file failure therefore stranded the transfer forever: never
retried, put.io source never cleaned up, never reported complete to *arr —
despite three log lines claiming it was being kept for retry.
shouldProcess now drops a failed transfer's context so the next poll sees it
as new, bounded by maxReprocessAttempts (mirroring the existing retry idiom
for errored put.io transfers) and deferred until the transfer has settled, so
a retry cannot queue a second generation of files still in flight.
torrent-remove now also drops the coordinator context and retry counters,
which is what keeps that tracking state from growing for the process
lifetime. Processed contexts still survive until then, since *arr queries
them as 100% complete until it removes the torrent.
Also removes the Server.Stop -> dlService.Stop layering inversion (main owns
that lifecycle and now stops the server first, then drains downloads), the
no-op net/http/pprof import, and a duplicated active-file counting loop.
fix(download): retry transfers whose local download failed
Nothing ever removed a TransferContext from the coordinator, and the
'already being processed' check treated any tracked transfer as in flight.
One permanent file failure therefore stranded the transfer forever: never
retried, put.io source never cleaned up, never reported complete to *arr —
despite three log lines claiming it was being kept for retry.
shouldProcess now drops a failed transfer's context so the next poll sees it
as new, bounded by maxReprocessAttempts (mirroring the existing retry idiom
for errored put.io transfers) and deferred until the transfer has settled, so
a retry cannot queue a second generation of files still in flight.
torrent-remove now also drops the coordinator context and retry counters,
which is what keeps that tracking state from growing for the process
lifetime. Processed contexts still survive until then, since *arr queries
them as 100% complete until it removes the torrent.
Also removes the Server.Stop -> dlService.Stop layering inversion (main owns
that lifecycle and now stops the server first, then drains downloads), the
no-op net/http/pprof import, and a duplicated active-file counting loop.
fix(download): retry transfers whose local download failed
Nothing ever removed a TransferContext from the coordinator, and the
'already being processed' check treated any tracked transfer as in flight.
One permanent file failure therefore stranded the transfer forever: never
retried, put.io source never cleaned up, never reported complete to *arr —
despite three log lines claiming it was being kept for retry.
shouldProcess now drops a failed transfer's context so the next poll sees it
as new, bounded by maxReprocessAttempts (mirroring the existing retry idiom
for errored put.io transfers) and deferred until the transfer has settled, so
a retry cannot queue a second generation of files still in flight.
torrent-remove now also drops the coordinator context and retry counters,
which is what keeps that tracking state from growing for the process
lifetime. Processed contexts still survive until then, since *arr queries
them as 100% complete until it removes the torrent.
Also removes the Server.Stop -> dlService.Stop layering inversion (main owns
that lifecycle and now stops the server first, then drains downloads), the
no-op net/http/pprof import, and a duplicated active-file counting loop.
fix(download): retry transfers whose local download failed
Nothing ever removed a TransferContext from the coordinator, and the
'already being processed' check treated any tracked transfer as in flight.
One permanent file failure therefore stranded the transfer forever: never
retried, put.io source never cleaned up, never reported complete to *arr —
despite three log lines claiming it was being kept for retry.
shouldProcess now drops a failed transfer's context so the next poll sees it
as new, bounded by maxReprocessAttempts (mirroring the existing retry idiom
for errored put.io transfers) and deferred until the transfer has settled, so
a retry cannot queue a second generation of files still in flight.
torrent-remove now also drops the coordinator context and retry counters,
which is what keeps that tracking state from growing for the process
lifetime. Processed contexts still survive until then, since *arr queries
them as 100% complete until it removes the torrent.
Also removes the Server.Stop -> dlService.Stop layering inversion (main owns
that lifecycle and now stops the server first, then drains downloads), the
no-op net/http/pprof import, and a duplicated active-file counting loop.