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

Retry http failures in ServiceAccountCredentials.refreshAccessToken #91

Closed
garrettjonesgoogle opened this issue Mar 10, 2017 · 1 comment
Assignees
Labels
🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@garrettjonesgoogle
Copy link
Member

As reported in googleapis/google-cloud-java#1545 , users have seen failures in ServiceAccountCredentials.refreshAccessToken, which has no retries on the http call. These failures should be retried.

java.io.IOException: Error getting access token for service account:
         at com.google.auth.oauth2.ServiceAccountCredentials.refreshAccessToken(ServiceAccountCredentials.java:319)
         at com.google.auth.oauth2.OAuth2Credentials.refresh(OAuth2Credentials.java:149)
         at com.google.auth.oauth2.OAuth2Credentials.getRequestMetadata(OAuth2Credentials.java:135)
         at com.google.auth.http.HttpCredentialsAdapter.initialize(HttpCredentialsAdapter.java:96)
         at com.google.cloud.HttpServiceOptions$1.initialize(HttpServiceOptions.java:224)
         at com.google.api.client.http.HttpRequestFactory.buildRequest(HttpRequestFactory.java:93)
         at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:423)
         at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:352)
         at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:469)
         at com.google.cloud.storage.spi.DefaultStorageRpc.create(DefaultStorageRpc.java:245)
         ... 10 more
 Caused by: java.net.SocketTimeoutException: connect timed out
  ...
@tcoffee-google
Copy link
Contributor

Following testing investigations: Due to the limitations of various mechanisms available for dealing with timeouts in this context, it looks as though it will be exceedingly complicated to configure retrying in a way that's reliably compatible with the retrying specification used in GAX. Thus, for this use case, I'm planning to abandon this approach and instead use the distinct retrying functionality native to google-http-java-client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

4 participants