Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase channel's buffer size #392

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lolraft/src/communicator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ impl RaftConnection {
pub fn new(self_node_id: NodeId, dest_node_id: NodeId) -> Self {
let client = {
let endpoint = tonic::transport::Endpoint::from(dest_node_id.0.clone())
.buffer_size(1 << 16)
// (http2) Send ping to keep connection (default: disabled)
.http2_keep_alive_interval(Duration::from_secs(1))
// (http2) Send ping even if there is no active streams (default: disabled)
Expand Down
3 changes: 2 additions & 1 deletion tests/env/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,10 @@ impl Env {
.or_insert_with(|| {
let uri: Uri = address_from_id(id).parse().unwrap();
let endpoint = Endpoint::from(uri)
.buffer_size(1<<16)
.http2_keep_alive_interval(std::time::Duration::from_secs(1))
.keep_alive_while_idle(true)
.timeout(std::time::Duration::from_secs(5))
.timeout(std::time::Duration::from_secs(30))
.connect_timeout(std::time::Duration::from_secs(5));
let chan = endpoint.connect_lazy();
chan
Expand Down
Loading