Skip to content

Commit f6758ed

Browse files
author
Stefan Effenberger
committed
changed web3 timeout handling
1 parent a694410 commit f6758ed

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/web3.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,12 +836,16 @@ mod streaming_trace {
836836
}
837837

838838
/// Send a JSON-RPC POST and return the raw response (not deserialized).
839+
/// Uses a fixed 120-second per-read timeout (via `.timeout()`) instead of
840+
/// the user-configured `web3_timeout`, so that arbitrarily large streaming
841+
/// responses can be consumed while still detecting server stalls promptly.
839842
fn send_blocking_web3_post_raw(
840843
config: &DVFConfig,
841844
request_body: &serde_json::Value,
842845
) -> Result<reqwest::blocking::Response, ValidationError> {
843846
let client = Client::builder()
844-
.timeout(Duration::from_millis(config.web3_timeout))
847+
.connect_timeout(Duration::from_millis(config.web3_timeout))
848+
.timeout(Duration::from_secs(120))
845849
.build()
846850
.unwrap();
847851

0 commit comments

Comments
 (0)