Stabilize Route Learning with Active/Backup Path Failover#1777
Open
robekl wants to merge 1 commit intomeshcore-dev:devfrom
Open
Stabilize Route Learning with Active/Backup Path Failover#1777robekl wants to merge 1 commit intomeshcore-dev:devfrom
robekl wants to merge 1 commit intomeshcore-dev:devfrom
Conversation
Replace first-packet-wins route replacement with a simple active+backup model per contact. New path candidates are evaluated conservatively: shorter paths can promote to active, while others remain backup candidates. Direct path failures are counted, and repeated timeouts trigger backup activation when available. If no backup is usable, direct routing is temporarily blocked for that contact so sends fall back to flood and relearn under current conditions. Path-update callbacks now fire only when the active path changes, reducing unnecessary write/notify churn.
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.
Summary
This change replaces the effective “first packet wins” route behavior with a simple, embedded-safe active/backup path strategy for contacts. It adds bounded failover logic for direct routing and reduces unnecessary path-update churn.
Problem
Current route learning is vulnerable to path churn:
In practice, this can make delivery quality inconsistent even when the mesh is otherwise healthy.
Impact When It Happens
When path churn occurs, users can see:
Scope of the Problem
This primarily affects contact-based direct messaging/request flows in dynamic conditions:
Static/small meshes are less affected but can still hit this during topology changes.
Description of the Change
The implementation introduces a bounded per-contact routing state and simple switching rules:
Behavioral updates:
How This Addresses the Problem
The change adds local route stability without protocol changes:
This shifts behavior from reactive single-route churn to controlled two-route resilience.
Scope of the Fix
In scope:
Out of scope:
Benefits
Drawbacks / Tradeoffs
New Complexity Introduced
ROI
High.