Skip to content

Commit 3d1e0f8

Browse files
[release-22.0] Throttler: keep watching topo even on error (#18223) (#18322)
Signed-off-by: Shlomi Noach <[email protected]> Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com>
1 parent 4e9c8ac commit 3d1e0f8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

go/vt/srvtopo/server.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ type Server interface {
4242
// GetSrvKeyspace returns the SrvKeyspace for a cell/keyspace.
4343
GetSrvKeyspace(ctx context.Context, cell, keyspace string) (*topodatapb.SrvKeyspace, error)
4444

45+
// WatchSrvKeyspace starts watching the SrvKeyspace object for changes. The callback function is called upon change.
46+
// The callback function should return `true` if it wishes to continue watching for further changes, or `false` if it
47+
// is done and wants to stop watching.
4548
WatchSrvKeyspace(ctx context.Context, cell, keyspace string, callback func(*topodatapb.SrvKeyspace, error) bool)
4649

4750
// WatchSrvVSchema starts watching the SrvVSchema object for

go/vt/vttablet/tabletserver/throttle/throttler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ func (throttler *Throttler) WatchSrvKeyspaceCallback(srvks *topodatapb.SrvKeyspa
380380
if !topo.IsErrType(err, topo.Interrupted) && !errors.Is(err, context.Canceled) {
381381
log.Errorf("WatchSrvKeyspaceCallback error: %v", err)
382382
}
383-
return false
383+
return true
384384
}
385385
throttlerConfig := throttler.normalizeThrottlerConfig(srvks.ThrottlerConfig)
386386

0 commit comments

Comments
 (0)