Skip to content

Commit

Permalink
Increased HTTP/2 keep alive timeouts to avoid server disconnecting cl…
Browse files Browse the repository at this point in the history
…ients with too many pings (#66)
  • Loading branch information
abdolence authored Mar 12, 2023
1 parent 59b8946 commit 0c757e8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gcloud-sdk/src/api_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ impl GoogleEnvironment {
Ok(Channel::from_shared(api_url_string)?
.tls_config(tls_config)?
.connect_timeout(Duration::from_secs(30))
.tcp_keepalive(Some(Duration::from_secs(5)))
.tcp_keepalive(Some(Duration::from_secs(60)))
.keep_alive_timeout(Duration::from_secs(60))
.http2_keep_alive_interval(Duration::from_secs(10))
.http2_keep_alive_interval(Duration::from_secs(60))
.keep_alive_while_idle(true)
.connect()
.await?)
Expand All @@ -237,9 +237,9 @@ impl GoogleEnvironment {
) -> Result<Channel, crate::error::Error> {
Ok(Channel::from_shared(api_url.as_ref().to_string())?
.connect_timeout(Duration::from_secs(30))
.tcp_keepalive(Some(Duration::from_secs(5)))
.keep_alive_timeout(Duration::from_secs(60))
.http2_keep_alive_interval(Duration::from_secs(10))
.tcp_keepalive(Some(Duration::from_secs(60)))
.keep_alive_timeout(Duration::from_secs(60 ))
.http2_keep_alive_interval(Duration::from_secs(60))
.keep_alive_while_idle(true)
.connect()
.await?)
Expand Down

0 comments on commit 0c757e8

Please sign in to comment.