Skip to content

Commit

Permalink
Merge pull request #5476 from planetscale/jacques_vtexplain
Browse files Browse the repository at this point in the history
Fix vtexplain race by waiting around for the fakesqldb tabletserver
  • Loading branch information
demmer authored Nov 27, 2019
2 parents 5f7f12b + 5d5e150 commit 0e90bab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion go/mysql/fakesqldb/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ func (db *DB) Close() {
db.listener.Close()
db.acceptWG.Wait()

db.WaitForClose(250 * time.Millisecond)
db.CloseAllConnections()

tmpDir := path.Dir(db.socketFile)
Expand All @@ -213,7 +214,7 @@ func (db *DB) Close() {

// CloseAllConnections can be used to provoke MySQL client errors for open
// connections.
// Make sure to call WaitForShutdown() as well.
// Make sure to call WaitForClose() as well.
func (db *DB) CloseAllConnections() {
db.mu.Lock()
defer db.mu.Unlock()
Expand Down

0 comments on commit 0e90bab

Please sign in to comment.