weaveworks / mesh

A tool for building distributed applications.
Apache License 2.0
889 stars 107 forks source link

Topology update broadcasts are sent once per route calculation #109

Closed bboreham closed 5 years ago

bboreham commented 5 years ago

Topology updates, either sent directly or received from other peers, are sent via GossipChannel.relayBroadcast(). It calls routes.ensureRecalculated(), which has three possible behaviours:

  1. if no recalculation is pending, it returns straight away
  2. if a recalculation is pending and nobody else is waiting, it will wait for that recalculation to start then finish
  3. otherwise it will queue for an opportunity to do 1 or 2

This means that, when recalculations are plentiful, e.g. when a large cluster is forming, each update waits for one recalc. We saw this when trying to get #106 to work.

I believe the idea was that ensureRecalculated() would wait for any previously-requested recalc to finish, but not wait for any future recalcs that might become necessary.

bboreham commented 5 years ago

Fixed by #110