-
Notifications
You must be signed in to change notification settings - Fork 227
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
rpc: Add HTTP timeout, default 30 seconds. #1380
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1380 +/- ##
=======================================
+ Coverage 59.0% 59.9% +0.8%
=======================================
Files 275 275
Lines 27930 27529 -401
=======================================
+ Hits 16505 16508 +3
+ Misses 11425 11021 -404 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good API-wise.
Can we follow the behavior in reqwest
and have "no timeout" behavior by default? This will be also the least disruptive to the current users of HttpClient
.
Hey! We are looking forward for this to be merged because we have the issue of our request being stuck. Anything we can do so it can be merged soon ? |
Note that you can use e.g. That said, if you do end up adding this functionality in a first-class manner, I think it would also be good if it were on-by-default. |
I'd argue that "no timeout" behavior is unexpected and thus not a good default (even though that seems to be the default for reqwest). As @tony-iqlusion mentioned, |
@tony-iqlusion Thanks for your solution. I agree with @mdyring, the "no timeout" is unexpected and I am in favor of a default value around 30secs. |
Added a temp solution for the timeout issue. This PR add a timeout of 30secs which will lead to the indexer to crash if it doesn't get an answer from the RPC-JSON. This is temp until the informalsystems/tendermint-rs#1380 is merged in lib.
I am totally in favor of adding a timeout parameter but would rather not enable it by default. I don't believe there exists a single good default value for such a library, since different applications will need different timeout values. Moreover, other HTTP client libraries like What do you think @tony-iqlusion? |
Personally I'm biased towards on-by-default timeouts, but having any sort of built-in timeout would be nice. |
Alright, I'll rest my case then since you guys all agree that having a timeout by default is the preferred behaviour. |
Simply introduces a HTTP timeout parameter, which is passed to reqwest.
This is highly desirable a the default behaviour is "no timeout", which can result in stalls.
Closes #1379.
.changelog/