Skip to content

Commit 35939df

Browse files
committed
bugfix: load and usage schema data race
We need to block shards to avoid schema usage by concurrent requests. Now it can be a ping request or a watch request so it does not look critical. We don't expect many of this requests and such requests do not use schema at all. Part of #218
1 parent b8a203e commit 35939df

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

schema.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,10 @@ func (conn *Connection) loadSchema() (err error) {
329329
schema.SpacesById[index.SpaceId].Indexes[index.Name] = index
330330
}
331331

332+
conn.lockShards()
332333
conn.Schema = schema
334+
conn.unlockShards()
335+
333336
return nil
334337
}
335338

0 commit comments

Comments
 (0)