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 logic issue: handlers.removePeer() is called twice. #856

Merged
merged 4 commits into from
Apr 24, 2022
Merged

fix logic issue: handlers.removePeer() is called twice. #856

merged 4 commits into from
Apr 24, 2022

Commits on Jan 28, 2022

  1. Merge pull request #743 from binance-chain/develop

    [R4R] Release v1.1.8
    unclezoro authored Jan 28, 2022
    Configuration menu
    Copy the full SHA
    859186f View commit details
    Browse the repository at this point in the history

Commits on Apr 8, 2022

  1. Merge pull request #850 from bnb-chain/develop

    [R4R] Release v1.1.9
    unclezoro authored Apr 8, 2022
    Configuration menu
    Copy the full SHA
    74ecbf2 View commit details
    Browse the repository at this point in the history

Commits on Apr 12, 2022

  1. fix logic issue: handlers.removePeer() is called twice.

    There is a logic issue which cause "Ethereum peer removal failed, err=peer not registered" occur quite often.
    
    handler.runEthPeer set up a defer removePeer(). This is always called after a peer is disconnected.
    However removePeer is also called by mulitple functions like downloader/fetcher.  After those kind of functions removePeer(), peer handler executes defer removePeer(). This makes removePeer() happened twice, and this is the reason we often see "Ethereum peer removal failed, err=peer not registered".
    
    To solve this, removePeer only needs to hard Disconnect peer from networking layer. Then defer unregisterPeer() will do the cleanup task after then.
    Jolly23 committed Apr 12, 2022
    Configuration menu
    Copy the full SHA
    b0156b1 View commit details
    Browse the repository at this point in the history
  2. fix: modify test function for close testing.

    reference from go-thereum.
    Jolly23 committed Apr 12, 2022
    Configuration menu
    Copy the full SHA
    4095205 View commit details
    Browse the repository at this point in the history