feat: make atServer address lookup resilient to transient failures to reach atDirectory #401
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.
closes #368
- What I did
SecondaryUrlFinder
. If root lookup fails with an exception, the lookup will be retried up to four times, with default delays of 50, 100, 150 and 200 after each failure.retryDelaysMillis
a public static variable inSecondaryUrlFinder
; this allows clients to control (1) how many retries are done and (2) the delay after each subsequent retry- How I did it
Note to reviewers: the 'real' changes are in
cacheable_secondary_address_finder.dart
andsecondary_address_cache_test.dart
. Changes to other test files are just the results of refactoring of some shared test code.SecondaryUrlFinder
so that it will retry up to 4 (number of retries is configurable) times with delays of [50, 100, 150, 200] milliseconds respectively (these delays are configurable) in the event of some exception while creating a connection to the atDirectorySecondaryUrlFinder
to allow injection of a socket factory, so we can test in unit testsretryDelaysMillis
a public static varaiable in SecondaryUrlFinder; this allows clients to control (1) how many retries are done and (2) the delay after each subsequent retrycreateMockSecureSocket
function and moved into at_lookup_test_utils.dart- How to verify it