feat(download): implement parallel download workers with retry and backoff #137
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/pget!137
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/parallel-download-workers"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Implement the core parallel download engine: worker pool, chunked download for HTTP and FTP, file pre-allocation,
WriteAtpositioning, and retry with exponential backoff.Why
This is the heart of pget — orchestrates N concurrent workers to download chunks and assemble them into the output file.
Testing
go vet ./...passesgo build ./...passesgolangci-lint run ./...passesBreaking Changes
Removed
internal/downloader/downloader.gostub — replaced bydownload.go.Notes
Download()— main entry point: probes URL, splits chunks, spawns workersRangeheader +http.Client.Do()with context cancellationRetrFrom(offset)for chunked downloadspreallocFile— creates sparse file viaTruncate(size)writeAtSeeker— wraps*os.File+WriteAtfor per-chunk offset positioningCloses #0040
Closes #0041
Closes #0042
Closes #0043
Closes #0044
Closes #0045
Closes #0046
Review: APPROVED
Verification
go vet ./...— ✅ passesgo build ./...— ✅ passesgolangci-lint v2 run ./...— ✅ 0 issuesChanges
internal/downloader/download.go(new, 207 lines) — Download engine: worker pool, chunked HTTP/FTP download, WriteAt positioning, retry with exponential backoff, single-threaded fallbackinternal/downloader/downloader.go— deleted (replaced by download.go)ROADMAP.md— Marks Phase 2 parallel download items as [x]Suggestions (non-blocking)
Closes #0040, #0041, #0042, #0043, #0044, #0045, #0046 on merge.