tomusdrw / rust-web3

Ethereum JSON-RPC multi-transport client. Rust implementation of web3 library. ENS address: rust-web3.eth
MIT License
1.45k stars 471 forks source link

Concurrent Http Requests Hanging #546

Closed fabioberger closed 3 years ago

fabioberger commented 3 years ago

When making concurrent requests using futures::future::try_join_all and the rust-web3 HTTP transport, some requests hang indefinitely despite the backing Ethereum node responding successfully (Status 200) to all the requests. The issue is intermittent and only happens sometimes.

Does rust-web3 support making concurrent HTTP requests using a single web3::Web3 instance?

fabioberger commented 3 years ago

The issue was on my end. My async main function was calling a sync function which would then call an async function, and this was causing intermittent hanging requests. Removing this unnecessary indirection solved the issue and rust-web3 supports concurrent requests beautifully.