mirror of
https://github.com/saltbo/zpan.git
synced 2026-09-21 13:20:33 +08:00
The previous fix gated control-task settling on listStaleIds, which only returns downloaders that are still status='online' with a stale heartbeat — the online→offline transition. A downloader marked offline by an earlier sweep is never returned again, so a canceling/pausing task it held stayed stuck forever (exactly the observed case). The early 'no new stale downloaders' return made it worse. Add listUnreachableIds (heartbeat past the lease, any status) and settle canceling→canceled / pausing→paused for those every sweep (idempotent), independent of the requeue+markOffline transition path. Regression test now flips the downloader to status='offline' before recovery — the case the prior fix missed.