gh-48: Report slow downloads - #391
Draft
Punisheroot wants to merge 1 commit into
Draft
Conversation
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.
Summary
Rationale
PyManager intentionally does not announce every download because operations such as traversing a chain of
index.jsonfiles would become noisy. However, a download that remains silent for several seconds can look as though the command has stalled.Each network request now records a monotonic start time. Its shared progress handler emits one warning after five seconds only when the caller has not supplied a progress callback and the operation is not already complete. The request's existing string conversion sanitizes credentials before the URL is logged.
The check remains progress-driven, matching the existing delayed warnings in
rmtreeandunlink, and does not create a timer thread for every short-lived index request. Silent BITS jobs are checked during their existing polling loop, urllib requests recheck after connecting, and the PowerShell fallback polls once per second only when there is no visible progress callback. The existing ten-second PowerShell startup timeout is preserved.Validation
tests/test_urlutils.py -k slow_download_warning: 5 passedtests/test_install_command.py -k download_package_yes_aborts_background_download: 1 passedgit diff --checkThe full native suite was not available locally because the installed interpreter does not match
_native_test.cp314; the repository CI builds that module with its pinned Python 3.14.6 runtime.Fixes #48