-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Close bad connection as notified by Heartbeat
in P2P code
#1567
Comments
@MitchTurner Is it ok if the test just test that the handler send a notification to disconnect or we want ot test it at service level ? Because I'm having difficulties testing this at service level. |
It might be the case that I was being overly prescriptive. It reads like typical TDD propaganda :). You have the context now to decide the best means of testing it, whether that is keeping the current arch or refactoring to a more testible design. |
I always prefer to get with test first too and I prefer testing it at service level but I don't find a way to make the failure_count increase in tests at service level. There is too much process going on etc... so I wll propably end up doing it at handler level even if it's not my preference. |
Context
During
poll
ourheartbeat::Handler
previously would count failed connection and close the connection after a set number of failures.They have since removed the ability for handlers to close connections: libp2p/rust-libp2p#4755
We still want bad connections to be closed and reopened, so we need a new solution.
Requirements
max_failures
, it closes the connection.The text was updated successfully, but these errors were encountered: