firebase-admin-go
firebase-admin-go copied to clipboard
Ability to override default retryconfig
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 :
- Is it possible to override default retryconfig?
- If so , how to go about doing this?
CC: @hiranya911
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.
@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.
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)
Can you provide me with any updates?
I would also be interested in updates on this topic.