Skip to content
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

Merged
merged 2 commits into from Mar 20, 2019

Conversation

goodsoft
Copy link
Contributor

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.

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.
@ghost ghost assigned goodsoft Mar 17, 2019
@ghost ghost added the in progress label Mar 17, 2019
@goodsoft goodsoft added ready for review This PR is ready for reviews. and removed in progress labels Mar 17, 2019
@@ -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
Copy link
Contributor

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", %{
Copy link
Contributor

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

@ghost ghost assigned vbaranov Mar 19, 2019
@ghost ghost added the in progress label Mar 19, 2019
@coveralls
Copy link

Pull Request Test Coverage Report for Build b8126845-f21a-4fe2-a7b8-ea5e81c7c5c6

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.6%) to 83.77%

Totals Coverage Status
Change from base Build afacb8a5-94a3-4deb-992f-b444a4d9908d: 1.6%
Covered Lines: 4289
Relevant Lines: 5120

💛 - Coveralls

Copy link
Contributor

@ayrat555 ayrat555 left a 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

@vbaranov vbaranov merged commit bb3666e into master Mar 20, 2019
@ghost ghost removed the in progress label Mar 20, 2019
@vbaranov vbaranov deleted the gs-jsonrpc-timeouts branch March 20, 2019 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review This PR is ready for reviews.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants