-
Notifications
You must be signed in to change notification settings - Fork 532
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Retry disconnect after connect when disconnect already happened (#16096)
## Description In prod, we have seen clients disconnect socket within 0.1ms after we log `connect_document` message. Even that telemetry is slightly delayed by a few operations before the log, so the actual time between `connect_document` message and `disconnect` event is likely even smaller in these cases. If `disconnect` is happening, essentially, immediately after `connect_document` message, then the work in #15769 is not enough to catch this race-condition, because it depends on variables that are set a few ticks after `connect_document` is received. To be absolutely certain that we catch this race condition, we can add a disconnect retry _after_ connectDocument completes whenever disconnect has already happened. ## Reviewer Guidance I know the code isn't super clean. Alfred Lambda is getting pretty messy. I think some cleanup of that 1,100 line file is warranted, but I don't have the time right now.
- Loading branch information
Showing
2 changed files
with
157 additions
and
71 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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