Skip to content

Commit

Permalink
[IMPROVED] Routing: reduce chances of duplicate implicit routes (#5602)
Browse files Browse the repository at this point in the history
This is an alternate approach to the PR #5484 from @wjordan.

Using the code in that PR with the test added in this PR, I could still
see duplicate routes (up to 125 in one of the matrix), and still had a
data race (that could have easily be fixed). The main issue is that the
increment happens in connectToRoute, which is running from a go routine,
so there were still chances for duplicates.

Instead, I took the approach that those duplicates were the result of
way too many gossip protocols. Suppose that you have servers A and B
already connected. C connects to A. A gossips to B that it should
connect to C. When that happened, B would gossip to A the server C and C
would gossip to A the server B, which all that was unnecessary. It would
grow quite fast with the size of the cluster (that is, several thousands
for a cluster size of 15 or so).

Resolves #5483

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
  • Loading branch information
derekcollison authored Jul 22, 2024
2 parents 8e9e7fd + 0bc2d18 commit 5b5857f
Show file tree
Hide file tree
Showing 3 changed files with 300 additions and 85 deletions.
Loading

0 comments on commit 5b5857f

Please sign in to comment.