Handle properly Google's tokeninfo 503/backend error#141
Handle properly Google's tokeninfo 503/backend error#141tangiel merged 1 commit intocloudendpoints:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #141 +/- ##
============================================
+ Coverage 79.95% 80.02% +0.06%
- Complexity 1673 1677 +4
============================================
Files 156 156
Lines 5573 5591 +18
Branches 725 729 +4
============================================
+ Hits 4456 4474 +18
+ Misses 841 840 -1
- Partials 276 277 +1
Continue to review full report at Codecov.
|
da07bd0 to
6aa81f3
Compare
tangiel
left a comment
There was a problem hiding this comment.
Mostly LGTM, just two minor comments. Thanks for doing this!
| @VisibleForTesting | ||
| static void configureErrorHandling(HttpRequest request) { | ||
| request.setNumberOfRetries(1) | ||
| .setThrowExceptionOnExecuteError(false) |
There was a problem hiding this comment.
This should be indented four spaces in.
| .setIOExceptionHandler(new HttpIOExceptionHandler() { | ||
| @Override | ||
| public boolean handleIOException(HttpRequest request, boolean supportsRetry) { | ||
| return true; //consider all IOException as transient |
There was a problem hiding this comment.
Super minor nit but please add a space after the // here and below.
6aa81f3 to
031de81
Compare
|
Fixed formatting (and too long lines as well). As there are only format change, I amended my commit and force pushed. I'm coding with IntelliJ, can you confirm I should use Google's style guide? |
tangiel
left a comment
There was a problem hiding this comment.
Yes, that should cover most of the formatting.
We are using Cloud Endpoints to serve a large scale API (millions of API requests per day).
We measure a low but significant amount of transient "503/backend error" when validating OAuth2 requests with GoogleAuth#getTokenInfoRemote, that translates into a "401/UnauthorizedException" for the API clients => this is not what one would expect for a transient exception.
This pull request introduce two main changes: