-
Notifications
You must be signed in to change notification settings - Fork 390
fix: Transform network failures into specific TLS timeout #2659
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
base: main
Are you sure you want to change the base?
Conversation
|
General comment but this logic will need to be ported to Gaxios in the future. |
|
This is a gentle reminder to please take a look when you have a moment. |
|
I'm not really sure why we are forcing things such as |
I agree completely—the current grouping is misleading. Thanks for the feedback! I've updated the error handling to distinguish these failures:
This provides a much more accurate diagnosis for the end-user. |
Transforms raw network errors (ECONNRESET, ETIMEDOUT, timed out, and TLS handshake) into a specific ApiError (code 408) with a descriptive message regarding potential CPU starvation. This prevents misleading error propagation from the underlying request library.
Splits network error handling: uses 408 for timeouts (timed out, ETIMEDOUT, TLS handshake) and 503 for connection resets (ECONNRESET) to improve retry logic accuracy.
Converts raw ECONNRESET, ETIMEDOUT, and TLS handshake failures into a standard Error object with an informative message. This helps diagnose CPU starvation or misleading 401 errors.
Replaces repetitive test cases in `makeAuthenticatedRequest` and `makeRequest` with a single, data-driven test loop. This verifies all conditions (ECONNRESET, ETIMEDOUT, "timed out", "TLS handshake") with reduced code duplication and improved maintenance. ```
…ilures Separates specific network transport errors (`ETIMEDOUT`, `ECONNRESET`) from genuine TLS handshake failures. The previous approach incorrectly categorized lower-level connection issues as "TLS errors," leading to misleading diagnostics for end-users. This change ensures accurate reporting based on the error pattern: - "tls handshake": Protocol/certificate issue. - "etimedout" / "timed out": Network timeout/availability. - "econnreset": Connection forcefully reset by host/intermediary.
4d68ab1 to
264beb5
Compare
|
@ddelgrosso1 For better readability, I’ve added some additional errors related to the network issue. Please review them. |
|
The new changes still suffer from the same issue, we are rewrapping errors and adding our own spin on what the cause may or may not be. We have gone to great lengths to not rewrap most errors thrown by the GCS server and I don't think this class of errors should be any different. I don't think this PR is at all necessary but someone is free to override me. |
Description
Impact
Testing
Additional Information
Checklist
Fixes #