fix: retry transient HTTP statuses and show friendly download errors#432
fix: retry transient HTTP statuses and show friendly download errors#432
Conversation
- HTTP 408/429/500/502/503/504 are now retried (up to 3 attempts with backoff) rather than failing immediately. Transient server-side errors can now self-heal instead of aborting the download. - DownloadException raised from comfy model download is rendered as a one-line red error with exit code 1, instead of a full Rich-panel Python traceback. comfy node install uses the existing display_error_message path. - Download progress bars now use transient=True so they disappear when the download completes. Running many downloads in sequence no longer leaves a stack of persistent bars. Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #432 +/- ##
==========================================
+ Coverage 76.63% 76.66% +0.03%
==========================================
Files 35 35
Lines 4279 4299 +20
==========================================
+ Hits 3279 3296 +17
- Misses 1000 1003 +3
🚀 New features to boost your workflow:
|
Summary
Fixes #430.
Three focused changes that together address the bug report (visual glitches + verbose tracebacks when pasting many
comfy model downloadcommands into a shell):_download_file_httpxnow raises a private_TransientHTTPStatusErrorfor statuses in{408, 429, 500, 502, 503, 504}, which the existing retry loop catches alongside network-level errors. CivitAI CDN blips and other transient server errors can now self-heal instead of aborting the download on the first attempt.comfy model downloadcatchesDownloadExceptionand prints a one-line red error before exiting with code 1, replacing the previous ~100-line Rich-panel Python traceback.comfy node installcatches it the same way, using the existingui.display_error_messagepath.ui.show_progressand_poll_aria2_downloadnow usetransient=True, so each progress bar is erased when its download completes. Running manycomfy model downloadcommands in sequence no longer leaves 30 persistent bars stacked in the terminal.Notes / follow-ups
Retry-Afterheader on 429 responses is not honored; fixed 2 s / 4 s backoff is used. Worth a follow-up if we see CivitAI or similar providers sending it.huggingface_hub.hf_hub_download) are not touched — they have their own error semantics.raise DownloadException("Filename cannot be empty")atcomfy_cli/command/models/models.py:315still produces a traceback because it sits above the newtry/except; unrelated to [Potential bug] Visual glitches and error #430 and can be cleaned up separately.