-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow reads concurrent to pending writes.
Thereby propagate pending write back-pressure via the paused command channels, rather than by "blocking" `Connection::next()` itself until a write completes. Notably, no new buffers are introduced. When a frame write cannot complete, command channels are paused and I/O reads can continue while the write is pending. The paused command channels exercise write back-pressure on the streams and API and ensure that the only frames we still try to send are those as a result of reading a frame - these then indeed wait for completion of the prior pending send operation, if any, but since it is done as a result of reading a frame, the remote can in turn write again, should it have been waiting to be able to do so before it in turn can read again. Unexpected write deadlocks of peers which otherwise read & write concurrently from substreams can thus be avoided.
- Loading branch information
Roman S. Borschel
committed
Feb 11, 2021
1 parent
4241ea4
commit 24d5464
Showing
6 changed files
with
312 additions
and
55 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
Oops, something went wrong.