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
Chunk JSON-RPC batches in case connection times out #1583
Conversation
There exists code to ensure long-running batch requests are split into smaller batches in case we receive 504 (Gateway Timeout) errorfrom loadbalancer. This PR adds handling of batches in the same manner in case there either is no balancer, or its timeouts are configured larger than indexer's, and thus the HTTP client library itself times out.
@@ -189,6 +189,98 @@ defmodule EthereumJSONRPC.HTTP.MoxTest do | |||
|
|||
assert MapSet.equal?(response_block_number_set, block_number_set) | |||
end | |||
|
|||
@tag :no_geth | |||
# Regression test for https://github.com/poanetwork/blockscout/issues/418 |
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.
is this right issue?
|
||
@tag :no_geth | ||
# Regression test for https://github.com/poanetwork/blockscout/issues/418 | ||
test "transparently splits batch payloads that would trigger a request timeout", %{ |
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 test is using Mox
for mocking HTTP requests. Can you please describe how HTTP timeout is simulated as described in the test's description
Pull Request Test Coverage Report for Build b8126845-f21a-4fe2-a7b8-ea5e81c7c5c6
💛 - Coveralls |
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.
comments were answered on standup
There exists code to ensure long-running batch requests are split into smaller
batches in case we receive 504 (Gateway Timeout) errorfrom loadbalancer.
This PR adds handling of batches in the same manner in case there either is no
balancer, or its timeouts are configured larger than indexer's, and thus the
HTTP client library itself times out.