firebase-admin-go icon indicating copy to clipboard operation
firebase-admin-go copied to clipboard

Ability to override default retryconfig

Open prashanthjbabu opened this issue 3 years ago • 5 comments

I understand that the following PR ( https://github.com/firebase/firebase-admin-go/pull/215/files ) brings in a default retryconfig which allows upto 4 retries . I did notice a comment there where there was some discussion around overriding this default retryconfig . Although it wasnt clearly specified how to go about doing it ( via some example ) . So the question I have is :

  1. Is it possible to override default retryconfig?
  2. If so , how to go about doing this?

CC: @hiranya911

prashanthjbabu avatar Dec 31 '21 05:12 prashanthjbabu

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

google-oss-bot avatar Dec 31 '21 05:12 google-oss-bot

@prashanthjbabu this is not possible today. RetryConfig is defined as an internal type -- https://github.com/firebase/firebase-admin-go/blob/6b40682756f19c6cf9b327843efaf06a4056a79e/internal/http_client.go#L365-L370

But, it would be useful to make it possible to configure the default retry behavior (may be via an App option or even an environment variable). @lahirumaramba FYA.

hiranya911 avatar Jan 05 '22 00:01 hiranya911

Came here to raise a similar request.

Currently the Default retry config checks for just one error (UNAVAILABLE aka 503).

The reason I would need to provide my own retry config is because the library does not handle the retry protocol as suggested by the firebase docs completely.

The firebase docs (https://firebase.google.com/docs/reference/fcm/rest/v1/ErrorCode) suggest retry should be done for the following error codes:

  • QUOTA_EXCEEDED
  • UNAVAILABLE
  • INTERNAL

if the default handler can handle this then users of this library wont need code up their own.

This would be a lot cleaner.

(I believe spanner libraries do the same, handle the retry in the client code)

sahejsingh avatar Jan 17 '22 04:01 sahejsingh

Can you provide me with any updates?

sheregeda avatar Jan 10 '24 08:01 sheregeda

I would also be interested in updates on this topic.

dani3lsf avatar Jan 18 '24 07:01 dani3lsf