From e634efd4a2c2f2cdf02eeb73f149e62b41774304 Mon Sep 17 00:00:00 2001 From: "vitess-bot[bot]" <108069721+vitess-bot[bot]@users.noreply.github.com> Date: Thu, 8 Feb 2024 09:56:20 +0100 Subject: [PATCH] [release-18.0] discovery: fix crash with nil server vschema (#15086) (#15092) Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com> --- go/vt/discovery/keyspace_events.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/go/vt/discovery/keyspace_events.go b/go/vt/discovery/keyspace_events.go index 163f240de8c..c2567da9a87 100644 --- a/go/vt/discovery/keyspace_events.go +++ b/go/vt/discovery/keyspace_events.go @@ -529,6 +529,11 @@ func (kss *keyspaceState) isServing() bool { // In addition, the traffic switcher updates SrvVSchema when the DeniedTables attributes in a Shard record is // modified. func (kss *keyspaceState) onSrvVSchema(vs *vschemapb.SrvVSchema, err error) bool { + // the vschema can be nil if the server is currently shutting down + if vs == nil { + return true + } + kss.mu.Lock() defer kss.mu.Unlock() kss.moveTablesState, _ = kss.getMoveTablesStatus(vs)