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

Fix scheduling of latest block polling in Realtime Fetcher #1545

Merged
merged 1 commit into from
Mar 11, 2019

Conversation

goodsoft
Copy link
Contributor

Timer is set using Elixir's Process.send_after/3 method, which is incompatible with Erlang's :timer module.
Thus, :timer.cancel doesn't have any effect on it, and in fact returns {:error, :badarg}.
This causes more and more polling being scheduled after every websocket event, which might cause excessive flooding of a node with eth_getBlockByNumber requests after some running time.

Timer is set using Elixir's `Process.send_after/3` method, which is incompatible with Erlang's `:timer` module.
Thus, `:timer.cancel` doesn't have any effect on it, and in fact returns `{:error, :badarg}`.
This causes more and more polling being scheduled after every websocket event, which might cause excessive flooding of a node with `eth_getBlockByNumber` requests after some running time.
@ghost ghost assigned goodsoft Mar 10, 2019
@ghost ghost added the in progress label Mar 10, 2019
@goodsoft goodsoft added ready for review This PR is ready for reviews. and removed in progress labels Mar 10, 2019
@coveralls
Copy link

Pull Request Test Coverage Report for Build 7c4d868f-8850-4438-b3dc-e1dc837ff375

  • 0 of 1 (0.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.5%) to 84.299%

Changes Missing Coverage Covered Lines Changed/Added Lines %
apps/indexer/lib/indexer/block/realtime/fetcher.ex 0 1 0.0%
Totals Coverage Status
Change from base Build 878bf9d1-ee44-4e11-b2c8-f5456dda24f6: 1.5%
Covered Lines: 4279
Relevant Lines: 5076

💛 - Coveralls

@vbaranov vbaranov merged commit 24350c1 into master Mar 11, 2019
@vbaranov vbaranov deleted the gs-fix-realtime-polling-scheduling branch March 11, 2019 08:48
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.

5 participants