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

libp2p connections can stick around in zombi mode #2388

Closed
dvc94ch opened this issue Dec 16, 2021 · 6 comments
Closed

libp2p connections can stick around in zombi mode #2388

dvc94ch opened this issue Dec 16, 2021 · 6 comments

Comments

@dvc94ch
Copy link
Contributor

dvc94ch commented Dec 16, 2021

this happens reliably when hot reloading our flutter application during testing. there is no inject_disconnected or inject_connected emitted, just a new inject_connection_established. this causes all sorts of weird behaviour as the other application when using NotifyHandler::Any will send the on the old connection that refuses to die.

@canewsin
Copy link
Contributor

Oh My, this is the reason My Flutter App hangs after hot reload, have to close and restart the App.

@mxinden
Copy link
Member

mxinden commented Dec 19, 2021

Does this happen on v0.41.0 or master? In other words, does this happen with #2350 included?

@dvc94ch
Copy link
Contributor Author

dvc94ch commented Dec 19, 2021

happens with #2350 included. but banning doesn't have anything to do with it. I'm thinking one solution would be to generate a random number at startup and send it with multistream-select. then if there was a state loss the other peer would detect it by receiving a new connection with a new session id or whatever you want to call it. that would then cause the swarm to close all the expired sessions and emit the proper events.

@mxinden
Copy link
Member

mxinden commented Dec 21, 2021

I am not sure I follow on the bug report itself. Would you mind describing the steps involved? How do connections get into the "zombie" state? Does one endpoint disconnect?

@dvc94ch
Copy link
Contributor Author

dvc94ch commented Dec 21, 2021

a connects to b
swarm a restarts
a connects to b
b has two connections from a
b sends messages on first connection which never arrive (which can be checked by using NotifyHandler::One(connection_id) instead of NotifyHandler::Any.

would add a test to reproduce it but it requires tons of boilerplate. wasn't there an effort to add an add_address to the swarm?

@dvc94ch
Copy link
Contributor Author

dvc94ch commented Dec 21, 2021

actually never mind. just thought that the other explanation is that the old swarm isn't shut down and somehow still around. seems like that's more likely

@dvc94ch dvc94ch closed this as completed Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants