From ee368e15f84ca44619dd3ead639ebe7d1610eb9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicent=20Mart=C3=AD?= <42793+vmg@users.noreply.github.com> Date: Tue, 30 Jan 2024 14:47:41 +0100 Subject: [PATCH] discovery: fix crash with nil server vschema (#15086) --- 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)