Skip to content

Commit

Permalink
Limit concurrency of .AddTablet() calls in topology watcher
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
  • Loading branch information
timvaillancourt committed Jan 18, 2024
1 parent bbbf3c2 commit fe2bdd8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions go/vt/discovery/topology_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,11 @@ func (tw *TopologyWatcher) loadTablets() {
topologyWatcherOperations.Add(topologyWatcherOpReplaceTablet, 1)
}
} else {
tw.sem <- 1 // Wait for active queue to drain.
// This is a new tablet record, let's add it to the healthcheck
tw.tabletRecorder.AddTablet(newVal.tablet)
topologyWatcherOperations.Add(topologyWatcherOpAddTablet, 1)
<-tw.sem // Done; enable next request to run
}
}

Expand Down

0 comments on commit fe2bdd8

Please sign in to comment.