-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
Even though the retry field is read it seems like it is not really used for the reconnection time.
Here the field is read to _retryDelay:
dotnet-eventsource/src/LaunchDarkly.EventSource/EventSource.cs
Lines 408 to 414 in ee3c875
| else if (result.IsRetryField) | |
| { | |
| if (long.TryParse(result.GetValueAsString(), out var retry)) | |
| { | |
| _retryDelay = TimeSpan.FromMilliseconds(retry); | |
| } | |
| } |
But _retryDelay is not really used for the reconnection time:
dotnet-eventsource/src/LaunchDarkly.EventSource/EventSource.cs
Lines 201 to 211 in ee3c875
| private async Task MaybeWaitWithBackOff() { | |
| if (_retryDelay.TotalMilliseconds > 0) | |
| { | |
| TimeSpan sleepTime = _backOff.GetNextBackOff(); | |
| if (sleepTime.TotalMilliseconds > 0) { | |
| _logger.Info("Waiting {0} milliseconds before reconnecting...", sleepTime.TotalMilliseconds); | |
| BackOffDelay = sleepTime; | |
| await Task.Delay(sleepTime); | |
| } | |
| } | |
| } |
Instead it is only passed initially for construction of ExponentialBackoffWithDecorrelation:
| _backOff = new ExponentialBackoffWithDecorrelation(_retryDelay, _configuration.MaxRetryDelay); |
The _minimumDelay in ExponentialBackoffWithDecorrelation is never updated
Metadata
Metadata
Assignees
Labels
No labels