Skip to content

Commit

Permalink
firehose: Set a timeout for grpc requests (#3855)
Browse files Browse the repository at this point in the history
  • Loading branch information
leoyvens authored Aug 17, 2022
1 parent ba86fd6 commit 7477d52
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion graph/src/firehose/endpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ impl FirehoseEndpoint {
let endpoint = endpoint_builder
.initial_connection_window_size(Some((1 << 31) - 1))
.connect_timeout(Duration::from_secs(10))
.tcp_keepalive(Some(Duration::from_secs(15)));
.tcp_keepalive(Some(Duration::from_secs(15)))
// Timeout on each request, so the timeout to estabilish each 'Blocks' stream.
.timeout(Duration::from_secs(30));

// Load balancing on a same endpoint is useful because it creates a connection pool.
let channel = Channel::balance_list(iter::repeat(endpoint).take(conn_pool_size as usize));
Expand Down

0 comments on commit 7477d52

Please # to comment.