Skip to content

Retry field not used correctly #92

Description

@thorstenfleischmann

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:

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:

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions