Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show when we retried requests #4725

Merged
merged 3 commits into from
Jul 2, 2024
Merged

Show when we retried requests #4725

merged 3 commits into from
Jul 2, 2024

Conversation

konstin
Copy link
Member

@konstin konstin commented Jul 2, 2024

In #3514 and #2755, users had intermittent network errors, but it was not always clear whether we had already retried these requests or not. Building upon TrueLayer/reqwest-middleware#159, this PR adds the number of retries to the error message, so we can see at first glance where we're missing retries and where we might need to change retry settings.

Example error trace:

Could not connect, are you offline?
  Caused by: Request failed after 3 retries
  Caused by: error sending request for url (https://pypi.org/simple/uv/)
  Caused by: client error (Connect)
  Caused by: dns error: failed to lookup address information: Name or service not known
  Caused by: failed to lookup address information: Name or service not known

This code is ugly since i'm missing a better pattern for attaching context to reqwest middleware errors in TrueLayer/reqwest-middleware#159.

In #3514 and #2755, users had intermittent network errors, but it was not always clear whether we had already retried these requests or not. Building upon TrueLayer/reqwest-middleware#159, this PR adds the number of retries to the error message, so we can see at first glance where we're missing retries and where we might need to change retry settings.

Example error trace:

```
Could not connect, are you offline?
  Caused by: Request failed after 3 retries
  Caused by: error sending request for url (https://pypi.org/simple/uv/)
  Caused by: client error (Connect)
  Caused by: dns error: failed to lookup address information: Name or service not known
  Caused by: failed to lookup address information: Name or service not known
```

This code is ugly since i'm missing a better pattern for attaching context to reqwest middleware errors in TrueLayer/reqwest-middleware#159.
@konstin konstin added network Network connectivity e.g. proxies, DNS, and SSL tracing Verbose output and debugging error messages Messaging when something goes wrong and removed tracing Verbose output and debugging labels Jul 2, 2024
@zanieb
Copy link
Member

zanieb commented Jul 2, 2024

Should we wait to merge until we're off the git-deps?

@konstin
Copy link
Member Author

konstin commented Jul 2, 2024

I haven't gotten any feedback from the maintainers yet and i want to ship this in uv so we get better user reports for network failures.

@zanieb
Copy link
Member

zanieb commented Jul 2, 2024

👍 Can we open an issue to track moving them into the Astral org then?

@konstin konstin merged commit 4b19319 into main Jul 2, 2024
47 checks passed
@konstin konstin deleted the konsti/log-retries branch July 2, 2024 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages Messaging when something goes wrong network Network connectivity e.g. proxies, DNS, and SSL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants