From 798975ffa598a84b45ff21bb276d5b200d9ab0a6 Mon Sep 17 00:00:00 2001 From: Ivan Mironov Date: Sat, 17 Sep 2022 00:42:44 +0500 Subject: [PATCH] rpc-client: Use regular timeout value for pool idle timeout too Setting pool idle timeout to a value smaller than solana-watchtower's poll interval can fix following error: [2022-08-25T04:03:22.811160892Z INFO solana_watchtower] Failure 1 of 3: solana-watchtower testnet: Error: rpc-error: error sending request for url (https://api.testnet.solana.com/): connection closed before message completed It looks like this happens because either RPC servers or ISPs drop HTTP connections without properly notifying the client in some cases. Similar issue: https://github.com/hyperium/hyper/issues/2136. --- rpc-client/src/http_sender.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rpc-client/src/http_sender.rs b/rpc-client/src/http_sender.rs index 3b488a0af6..902f86ce63 100644 --- a/rpc-client/src/http_sender.rs +++ b/rpc-client/src/http_sender.rs @@ -60,6 +60,7 @@ impl HttpSender { reqwest::Client::builder() .default_headers(default_headers) .timeout(timeout) + .pool_idle_timeout(timeout) .build() .expect("build rpc client"), );