Skip to content

Commit

Permalink
RavenDB-20122 : UpdateTopologyChangeNotification - use reconnection b…
Browse files Browse the repository at this point in the history
…ackoff if cluster has no leader, in order to avoid high cpu when watcher is waiting for leader to come up
  • Loading branch information
aviv86 committed Dec 17, 2023
1 parent fc47909 commit 908f07d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Raven.Server/ServerWide/ServerStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,14 @@ public void UpdateTopologyChangeNotification()
{
var topology = GetClusterTopology();
var leader = _engine.LeaderTag;
if (leader == null || leader == _engine.Tag)

if (leader == null)
{
delay = ReconnectionBackoff(delay);
break;
}

if (leader == _engine.Tag)
break;

var leaderUrl = topology.GetUrlFromTag(leader);
Expand Down

0 comments on commit 908f07d

Please sign in to comment.