Add command-line flag to enable yamux flow control. (#4892)

* Add command-line flag to enable yamux flow control.

We never enabled proper flow-control for yamux streams which may cause
stream buffers to exceed their configured limit when the stream
producer outpaces the stream consumer. By switching the window update
mode to on-read, producers will only receive more sending credit when
all data has been consumed from the stream buffer. Using this option
creates backpressure on producers. However depending on the protocol
there is a risk of deadlock, if both endpoints concurrently attempt to
send more data than they have credit for and neither side reads before
finishing their writes. To facilitate proper testing, this PR adds a
command-line flag `use-yamux-flow-control`.

* Replace comment with generic message.
This commit is contained in:
Toralf Wittner
2020-02-12 11:24:25 +01:00
committed by GitHub
parent ae70b10326
commit 818c05bbc2
9 changed files with 32 additions and 8 deletions
+4
View File
@@ -238,6 +238,10 @@ pub struct NetworkConfigurationParams {
#[allow(missing_docs)]
#[structopt(flatten)]
pub node_key_params: NodeKeyParams,
/// Experimental feature flag.
#[structopt(long = "use-yamux-flow-control")]
pub use_yamux_flow_control: bool,
}
arg_enum! {