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

ConnectionEstablished is called in an already established connection #274

Open
majecty opened this issue Mar 18, 2020 · 1 comment
Open
Labels
bug Something isn't working

Comments

@majecty
Copy link
Contributor

majecty commented Mar 18, 2020

Recently, discovery5 tests failed occasionally.
I read the failed test log and found that a connection established event is fired in the already existing connection. It made Foundry crash.

Why this error found nowadays

Recently when we implementing a peer DB, we added an assertion that the same peer is not added twice in the DB. The assertion made Foundry panic.
It seems that the duplicated connection established event bug is aged, but recently found by the assertion.

How should we fix it

The "connection established" event should not be called in an existing connection.

ErrorLog

2020_03_18T01_56_17_226Z.1.log
2020_03_18T01_56_17_226Z.4.log

@majecty majecty added the bug Something isn't working label Mar 18, 2020
@majecty majecty changed the title ConnectionEstablished is called in the already established connection ConnectionEstablished is called in an already established connection Mar 18, 2020
@MSNTCS
Copy link
Contributor

MSNTCS commented Sep 9, 2020

The problem is that on_node_added is called several times with the same id. For now, in order to avoid the situation, we check whether the connection nodes contain the id inside on_node_added function which we should not.

The on_node_added function is called during the negotiation phase several times with the same id. My inspection is that the same negotiation message is sent several times by on node.

We keep PR #499 open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants