-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
all: close then re-dial client conn on context deadline
The current handling of context deadlines can lead to data ordering problems, in a racey manner. For example, if command is cancelled after the write succeeds, but before the response is read, subsequent commands may read the previous response data. This can be partially helped by always calling SetDeadline() instead of the Read/Write variants, but this is still racey. E.g., the server may initiate the read after we have initiated a new command and have cleared the deadline again. Instead, when a context is cancelled, call Close() on the underlying connection. Then, when another command request is made, re-dial the connection to give ourselves a clean slate.
- Loading branch information
Showing
4 changed files
with
92 additions
and
25 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
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