Conversation
… PollingRetryState
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Android equivalent of ios-client-sdk#533 (SDK-2802). The streaming and polling data sources stopped permanently on 401, 403, and most other 4xx statuses, and a 401 shut down the whole client. They now retry those failures with a longer backoff than other errors: 5 minutes, doubling to 1 hour. The client stays uninitialized and keeps trying.
Implementation notes:
RetryStateis the backoff state machine shared by all the data sources.Notes for reviewers:
TERMINAL_ERRORon a 401,FDv2DataSourcemoves to the next one at once, and the failed slot returns after a backoff instead of permanently. If every slot is backing off, the data source waits rather than reportingOFF.DataSourceUpdateSink.shutDown(). It stays in the interface for custom data sources.isRetryable()from the status code rather than alwaystrue.setOnline()starts a fresh backoff, because Android builds a new data source on every state change.Contract tests declare
retry-conformance-fdv1-streamingandretry-conformance-fdv1-polling, so the harness skips its legacy "do not retry" client tests.Testing
RetryStateTestcovers the backoff algorithm;SourceManagerTestcovers slot backoff.