pub-dev icon indicating copy to clipboard operation
pub-dev copied to clipboard

Retry `ClientException` from `package:http`

Open jonasfj opened this issue 1 year ago • 3 comments

We should probably also retry ClientException from package:http:

https://github.com/dart-lang/pub-dev/blob/031c368ea0840f2bdcf2bcaee7886a13c19b90b4/app/lib/shared/storage.dart#L142-L154

jonasfj avatar Nov 25 '24 15:11 jonasfj

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 avatar Dec 04 '24 08:12 isoos

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>

isoos avatar Dec 12 '24 10:12 isoos