Skip to content

Commit

Permalink
mutex protestion
Browse files Browse the repository at this point in the history
Signed-off-by: Shlomi Noach <[email protected]>
  • Loading branch information
shlomi-noach committed Feb 1, 2021
1 parent d6d8eed commit c6f758d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion go/vt/vttablet/tabletmanager/vreplication/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,11 @@ func (vre *Engine) InitDBConfig(dbcfgs *dbconfigs.DBConfigs) {
vre.dbName = dbcfgs.DBName

// Ensure the schema is created as early as possible
go vre.Exec(warmUpQuery)
go func() {
vre.mu.Lock()
defer vre.mu.Unlock()
vre.Exec(warmUpQuery)
}()
}

// NewTestEngine creates a new Engine for testing.
Expand Down

0 comments on commit c6f758d

Please sign in to comment.