-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weird Web3 object behaviour when using timeout in request_kwargs #3406
Comments
aiohttp's client timeout settings are actually set via passing values into a separate object, with a slightly more complex data structure and so passing just an int to it isn't likely to do anything. Also, the default timeout is 5 and I think the value are rounded because the timeout is set on the event loop level. The other caveat is that because the timeout is set on the event loop level for the client, it's going to be off by a little depending on your environment, and lower the setting the more off it may be unless it's None. Try running this modified version of your code, although the timeout (default is 300, since it is a timeout for the entire event loop) is likely too short anyway.
|
Thank you for explaining it :) |
What happened?
When i am using AsyncWeb3 with AsyncHttpProvider, i set request_kwargs={"timeout":2} like in the docs. It does not always raise a timeout error as it should. Sometimes it raises error after 9-10 seconds, and sometimes it doesn't even raise the error and i get back results despite almost 9 seconds passing by. That is more that 4 times the amount of set timeout.
Code that produced the error
Full error output
Fill this section in if you know how this could or should be fixed
No response
web3 Version
6.19.0
Python Version
3.11.9
Operating System
linux
Output from
pip freeze
The text was updated successfully, but these errors were encountered: