Skip to content

fix(syntaxis): correct download dispatch (slot leaks, retry wakeup, protocol guard) - #489

Merged
forkwright merged 1 commit into
mainfrom
fix/syntaxis-download-dispatch
Jul 2, 2026
Merged

fix(syntaxis): correct download dispatch (slot leaks, retry wakeup, protocol guard)#489
forkwright merged 1 commit into
mainfrom
fix/syntaxis-download-dispatch

Conversation

@forkwright

Copy link
Copy Markdown
Owner

Closes #393, #394, #424, #425, #426, #427, #428.

Changes

Verification

kanon gate --full green (fmt, check, advisory-parity, cargo-deny, clippy workspace, nextest, kanon lint). 179 tests across syntaxis + archon.

…rotocol guard)

- #393: extract the duplicated dispatch/spawn logic into one helper; a
  start_download failure now releases the slot, removes the active entry,
  marks the row failed, and pulls a replacement from the queue.
- #394: the retry re-enqueue now wakes the dispatcher (the spawned retry
  task calls the shared dispatch helper after backoff).
- #424: dispatch matches on protocol and fails a Usenet/NZB item loudly
  (marked-failed, slot rolled back) instead of silently mis-routing it to
  the BitTorrent engine. Full Usenet support is a separate feature.
- #425: collapse the priority-4 has_slot/acquire/insert into one critical
  section; losers demote to priority 3.
- #426: on broadcast Lagged (and a 60s periodic pass) reconcile active
  downloads against the engine so dropped DownloadCompleted events no
  longer permanently leak slots.
- #427: retry_count is carried on QueueItem and restored from the DB so the
  retry budget survives process restarts.
- #428: regression test that a retried download is re-dispatched after backoff.

Closes #393
Closes #394
Closes #424
Closes #425
Closes #426
Closes #427
Closes #428

Gate-Passed: kanon 0.1.5 +stages:fmt,check,clippy,nextest,lint sha:6f9621834cb6aeceb9cda349b84b610ae7e826d8
@forkwright
forkwright merged commit e11fd19 into main Jul 2, 2026
11 checks passed
@forkwright
forkwright deleted the fix/syntaxis-download-dispatch branch July 2, 2026 14:32
forkwright added a commit that referenced this pull request Jul 2, 2026
…it (#493)

#491 (ergasia) changed DownloadEngine::extract to async (impl Future) so
extraction runs off the executor; #489 (syntaxis) merged a test MockEngine
whose extract was still sync. The two PRs were each internally consistent
but ergasia was tested pre-syntaxis, so the stale mock only broke the
workspace build once both landed. Make the mock extract async.

Gate-Passed: kanon 0.1.5 +stages:fmt,check,clippy,nextest,lint sha:77b78bec2dcb0e1e949146db9e7a348590cc816e

Co-authored-by: forkwright <noreply@forkwright.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

start_download failure permanently leaks a concurrency slot, active entry, and DB row

1 participant