fix: broken fallback to single downloader - #519
Merged
Conversation
Binary Size Analysis
|
❌ Test Failures on
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Greptile Summary
This PR fixes two related gaps in the single-threaded download path:
DownloadPausedMsgwas never emitted when a single-threaded download was paused (the pool now sends it whenisPaused && err != nil), andActiveWorkerswas never set or cleared, leaving progress state inconsistent. It also adds rate-limit retry logic (429/503 Retry-After) to the single downloader and wiresUpdateChunkStatusintoprogressReaderso the chunk bitmap is populated during single-threaded transfers.pool.go): The discriminating conditionisPaused && err != nilcorrectly identifies single-threaded paused downloads (which return a non-nil error) vs. concurrent ones (which send the message themselves and return nil).single/downloader.go): Introduces a child context (dlCtx) for pause/cancel, deferredActiveWorkerslifecycle management, 429/503 retry-after loop, and chunk-bitmap updates viaprogressReader.flushWithTime.types/progress.go):SessionResetnow zeroesActiveWorkers; the noisyUpdateChunkStatusskipped debug log is removed since single-threaded downloads call it with no bitmap.Confidence Score: 5/5
The core bug fixes are correct and well-scoped; the two findings are minor quality concerns that do not affect correctness of the main fix.
The pause-message fix and ActiveWorkers lifecycle management are correct. The throttledReader context mismatch only causes marginal pause-response delay under rate limiting, and the missing retry tests do not affect current runtime behavior.
internal/engine/single/downloader.go — the rate-limit retry loop and the throttledReader context are the areas worth a second look
Important Files Changed
Reviews (4): Last reviewed commit: "feat: single downloader Retry-After" | Re-trigger Greptile
Context used: