-
Notifications
You must be signed in to change notification settings - Fork 12
feat: Improve authentication error logging and retry handling #140
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
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (73.52%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #140 +/- ##
============================================
- Coverage 83.47% 83.23% -0.25%
- Complexity 1271 1289 +18
============================================
Files 104 105 +1
Lines 3765 3859 +94
Branches 375 396 +21
============================================
+ Hits 3143 3212 +69
- Misses 462 475 +13
- Partials 160 172 +12
🚀 New features to boost your workflow:
|
Enhanced error logging and retry logic for authentication failures to
provide better visibility into transient server errors and improve
resilience against flaky authentication endpoints.
Changes:
- Enhanced AuthorizationException.getMessage() to include HTTP status
code and error description in a structured format
- Added AuthorizationException.isRetriable() method to identify
transient errors that should be retried:
* All 5xx server errors (500, 502, 503, 504, etc.)
* 400 errors with retry hints ("retry your request", "unknown_error")
* 429 rate limit errors
- Updated FormCommand to handle 5xx errors as AuthorizationException
instead of IOException for consistent retry handling
- Modified retry policy in DataCloudTokenProvider to retry retriable
AuthorizationExceptions while failing fast on permanent auth errors
- Added comprehensive retry logging:
* WARN logs on each retry attempt with attempt number and error details
* ERROR logs when all retries are exhausted
- Improved error logging in getWithRetry() to extract and log full
error details including HTTP codes and error descriptions
This improves debugging of authentication issues and makes the driver
more resilient to transient server-side failures commonly seen in
test environments.
fa56d30 to
2866da5
Compare
| // Retry on 400 errors that indicate transient issues | ||
| if (httpCode == 400) { | ||
| String description = errorDescription != null ? errorDescription.toLowerCase() : ""; | ||
| // Check for retry hints in the error description | ||
| return description.contains("retry") | ||
| || description.contains("unknown_error") | ||
| || description.contains("temporary") | ||
| || description.contains("rate limit") | ||
| || description.contains("throttle"); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you see this really occurring? Generally 400 looks to be something that the server consider a client error and thus I wouldn't retry on it https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/400.
Enhanced error logging and retry logic for authentication failures to provide better visibility into transient server errors and improve resilience against flaky authentication endpoints.
Changes:
This improves debugging of authentication issues and makes the driver more resilient to transient server-side failures commonly seen in test environments.