Fix cleaning send queue on restart (#18511) #21039
Merged
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.
Port of #18511
Description
When using the SignalR typescript/javascript client, if the connection to the server is interrupted (walked through a tunnel, etc.) and the automatic reconnect logic runs, the first time the client can successfully reconnect causes a reconnect failure and triggers another reconnect attempt.
Customer Impact
#17613 was reported and had multiple customers chime in with the same problem.
There are errors in the browser and it causes unnecessary traffic between client and server because it does a successful negotiate then fails and repeats the negotiate again. And since it increases the reconnection attempt count, it could either cause the client to stop connecting if it reaches the end of its reconnect loop or it could negatively impact custom reconnect logic from customers.
No.
Regression?
No, bug was introduced in the same release that auto reconnect was added.
Risk
Low. Problem is well understood and test was added to verify behavior.