Repository navigation
fix(no-ticket): stop a stalled download from waiting without a limit - #523
Open
cloudsmith-iduffy wants to merge 4 commits into
Open
cloudsmith-iduffy wants to merge 4 commits into
cloudsmith-iduffy wants to merge 4 commits into
Conversation
The package file request in stream_download had no timeout, so a server that stopped sending data made `cloudsmith download` wait forever. The request now has a (30, 60) second connect and read timeout. A read error during the transfer gives a ClickException. An HTTP error response is now closed, so it returns its connection to the session pool. Before, the fifth download on one session waited for a free connection without a limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused changes address the stated failure paths, include regression coverage, and have no identified blocking issues.
No open issues 🎉
What changed in this PR
This PR prevents stalled package downloads from waiting indefinitely and improves error handling in the CLI’s streaming download flow.
Changes:
- Adds 30-second connect and 60-second per-read timeouts.
- Converts streaming request failures into CLI errors and closes HTTP-error responses to release pool connections.
- Adds regression tests and changelog entries for the fixes.
| File | Description |
|---|---|
cloudsmith_cli/core/tests/test_download.py |
Tests timeout configuration, mid-stream failures, and HTTP-error response cleanup. |
cloudsmith_cli/core/download.py |
Adds download timeouts, streaming error handling, and HTTP-error cleanup. |
CHANGELOG.md |
Documents stalled-download and connection-pool fixes. |
Review effort: Balanced
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cloudsmith-iduffy
marked this pull request as ready for review
November 3, 2026 15:59
Copilot started work to resolve merge conflicts on behalf of
cloudsmith-iduffy
November 3, 2026 15:59
…-timeout # Conflicts: # CHANGELOG.md Co-authored-by: cloudsmith-iduffy <178375997+cloudsmith-iduffy@users.noreply.github.com>
This branch has not been deployed
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.
Description
cloudsmith downloadstreams the package file withsession.get(..., stream=True)and gave notimeout.requestshas no default timeout, and our session does not set one. So if the download server accepts the connection and then stops sending, the command waits forever with no error. Every other direct HTTP call in the CLI already passes a timeout.This PR:
(30, 60)second connect and read timeout (DOWNLOAD_TIMEOUT_SECONDSincore/download.py). The CLI has no configurable request-timeout option to reuse, so this is a module constant.ClickException, the same as an error on the first request. With a read timeout,requestsraises this asConnectionErrorfromiter_content, not asTimeout, so the wrapper catchesRequestException.--all-filesor--download-all), the fifth download hung. This is a second way for the same function to hang, and the timeout does not stop it.Type of Change
Additional Notes
RestClient, which still passes_request_timeout=None. A default timeout there belongs in its own PR.--overwrite.🤖 Generated with Claude Code