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

EVM-42 Remove WebSocket filter with closed connection #763

Merged

Conversation

Kourin1996
Copy link
Contributor

Fix EDGE-841

Description

This PR fixes the minor issue explained in #639

After web socket connection suddenly closed, the logs are shown like the following regularly.

[ERROR] polygon.filter: Unable to process flush, writev tcp 127.0.0.1:5000->127.0.0.1:52646: use of closed network connection

There was a cleanup function for closed connection. But the problem is this doesn't cover all possible cases. A net.ErrClosed, which the previous code didn't cover, is thrown when sending a connection that has closed forcibly. This PR adds the case of this error and unit test.

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Breaking changes

Please complete this section if any breaking changes have been made, otherwise delete it

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels
  • I have updated the official documentation
  • I have added sufficient documentation in code

Testing

  • I have tested this code with the official test suite
  • I have tested this code manually

Manual tests

  1. Start Polygon Edge and Blockscout
  2. Terminate the process of Blockscout forcibly (docker kill in case of docker container)
  3. Make sure there is no ERROR level logs

Documentation update

Please link the documentation update PR in this section if it's present, otherwise delete it

Additional comments

Please post additional comments in this section if you have them, otherwise delete it

Copy link
Contributor

@0xAleksaOpacic 0xAleksaOpacic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov
Copy link

codecov bot commented Sep 26, 2022

Codecov Report

Merging #763 (1845a64) into develop (7975703) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop     #763      +/-   ##
===========================================
+ Coverage    52.46%   52.49%   +0.02%     
===========================================
  Files          130      130              
  Lines        17069    17069              
===========================================
+ Hits          8955     8960       +5     
+ Misses        7469     7465       -4     
+ Partials       645      644       -1     
Impacted Files Coverage Δ
jsonrpc/filter_manager.go 77.17% <100.00%> (+0.20%) ⬆️
network/e2e_testing.go 63.89% <0.00%> (+0.36%) ⬆️
syncer/client.go 63.20% <0.00%> (+1.41%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@zivkovicmilos zivkovicmilos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing this up, and for figuring out the bug 🙏

You are clear to merge 🚀

@Kourin1996 Kourin1996 merged commit 98a40e1 into develop Oct 3, 2022
@Kourin1996 Kourin1996 deleted the EVM-42_error_unable_to_remove_closed_ws_connection branch October 3, 2022 10:50
@github-actions github-actions bot locked and limited conversation to collaborators Oct 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fix Functionality that fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants