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 ClientException from package:http #8337

Open
jonasfj opened this issue Nov 25, 2024 · 3 comments
Open

Retry ClientException from package:http #8337

jonasfj opened this issue Nov 25, 2024 · 3 comments
Assignees
Labels
Area: stackdriver error report Error reported through Stackdriver Error Reporting Type: bug

Comments

@jonasfj
Copy link
Member

jonasfj commented Nov 25, 2024

We should probably also retry ClientException from package:http:

retryIf: (e) {
if (e is TimeoutException) {
return true; // Timeouts we can retry
}
if (e is IOException) {
return true; // I/O issues are worth retrying
}
if (e is DetailedApiRequestError) {
final status = e.status;
return status == null || status >= 500; // 5xx errors are retried
}
return e is ApiRequestError; // Unknown API errors are retried
},

@jonasfj jonasfj added Type: bug Area: stackdriver error report Error reported through Stackdriver Error Reporting labels Nov 25, 2024
@isoos
Copy link
Collaborator

isoos commented Dec 4, 2024

I think we should refactor/merge the various retry methods we have to make sure every one of them uses the same retry logic. Keeping this issue open to track that.

@isoos
Copy link
Collaborator

isoos commented Dec 12, 2024

Another case in storage access:

Error:
    ClientException: Connection closed before full header was received, uri=https://storage.googleapis.com/storage/v1/b/dartlang-pub-exported-api/o/latest%2Fapi%2Farchives%2Fstacked-2.3.14.tar.gz?projection=full&alt=json

Stack:
    #0      IOClient.send (package:http/src/io_client.dart:156:7)
    <asynchronous suspension>
    #1      AuthenticatedClient.send (package:googleapis_auth/src/auth_http_utils.dart:41:22)
    <asynchronous suspension>
    #2      RetryClient.send (package:http/retry.dart:115:20)
    <asynchronous suspension>
    #3      ApiRequester.request (package:_discoveryapis_commons/src/api_requester.dart:69:20)
    <asynchronous suspension>
    #4      ObjectsResource.get (package:googleapis/storage/v1.dart:3422:23)
    <asynchronous suspension>
    #5      _BucketImpl.info.<anonymous closure> (package:gcloud/src/storage_impl.dart:255:15)
    <asynchronous suspension>
    #6      BucketExt.tryInfo (package:pub_dev/shared/storage.dart:79:14)
    <asynchronous suspension>
    #7      ExportedApi._findStrayFiles.<anonymous closure> (package:pub_dev/package/api_export/exported_api.dart:215:11)
    <asynchronous suspension>

@dejadior440
Copy link

app/lib/search/backend.dart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: stackdriver error report Error reported through Stackdriver Error Reporting Type: bug
Projects
None yet
Development

No branches or pull requests

3 participants