Skip to content

DLS v0.2.0 — mirrors, cooldown, size-aware concurrency, fairness

Choose a tag to compare

@Jestions-dev Jestions-dev released this 10 Nov 04:07
· 5 commits to main since this release

What's new

Mirror expansion GitHub Releases / HuggingFace / raw.githubusercontent / PyPI URLs gain a fallback mirror automatically. The original always stays first, and mirrors are only appended — never substituted.
Mirror cooldown Two consecutive failures on a host parks it for 10 minutes. Kept in memory only, so a restart clears it rather than turning a blip into a permanent ban.
Size-aware concurrency Under 1 MB skips aria2 entirely, 1–8 MB runs 4 connections, 8 MB and up gets 16. The size comes from a 5-second HEAD probe; if it fails the planner stays conservative at 8.
Session fairness When two sessions are queuing at once, each is capped at half the slots and the scheduler round-robins between them. A lone session still gets every slot.
Cumulative disk budget Enqueue now sums what already-queued jobs still need, so twenty "it fits" enqueues cannot quietly fill the disk.
Failures are loud Checkpoint write errors are counted and surfaced in download_status under storage. An unwritable destination is refused before the transfer starts.

Why storage appears in the output

A failing checkpoint means the next resume rewinds to a stale offset, which corrupts the file. v1 swallowed that write with .catch(() => {}). Now:

"storage": { "errors": 3, "lastError": "J#12: storage is read-only", "lastAt": 1794283232002 }

errors: 0 when everything is healthy.

Also fixed

Lifecycle writes (#fail, #stopAs, #finish, orphan cleanup, boot recovery) now go through a non-throwing helper. A broken storage used to surface as an exception from close(), which took down the shutdown path. A test exposed it.

Tests

13 offline cases, 10 of them new for this release. No network, no aria2, no DSH required.

node --test     # 13 pass

Install

dsh plugin add dsh-dl-server@0.2.0

Or in the UI: Settings → Plugins → Install a third-party plugin → Add plugin, and type dsh-dl-server@0.2.0.

Mirrors are best-effort: they cannot prove they serve the same bytes. Only sha256 can. The cooldown just stops dead hosts from being retried forever.