0.5.6: align _createPeer stale threshold with inbound handler (1s)#25
Merged
Conversation
v0.5.5 lowered the stale-prior threshold to 1s in the inbound-connection handler but left the _createPeer path on the old _heartbeatInterval (10s). When both sides dialled each other in rapid succession, the two paths could pick opposite winners — Mac-side and Node-side kept different connections, each killing the other's choice. Field testing showed a continuous ~6s join → disconnect cycle persisting after v0.5.5. Aligned both stale-detection sites on 1s.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
v0.5.5 lowered the stale-prior threshold to 1s in the inbound-connection handler but left the
_createPeerpath on the old_heartbeatInterval(10s).When both sides of a peer pair dial each other in rapid succession, the inbound handler accepts with the 1s rule but the merged
_createPeerre-evaluates with 10s and can pick the opposite winner. Mac-side and Node-side then keep different connections, each killing the other's choice — visible in field testing as a continuous ~6s join → disconnect cycle even after v0.5.5.What
Aligned both stale-detection sites on a hardcoded 1s threshold.
Tests