From c6f758d45247d90f3bf4c5f15c744b9b2e8b887c Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Mon, 1 Feb 2021 07:25:32 +0200 Subject: [PATCH] mutex protestion Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/vttablet/tabletmanager/vreplication/engine.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/go/vt/vttablet/tabletmanager/vreplication/engine.go b/go/vt/vttablet/tabletmanager/vreplication/engine.go index 76d26b7f869..f01dc7b5ec2 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/engine.go +++ b/go/vt/vttablet/tabletmanager/vreplication/engine.go @@ -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.