Skip to content

Commit

Permalink
executer: fix data race (#30186)
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkingrei committed Nov 29, 2021
1 parent 6756bd2 commit 3487bb7
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions executor/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -4698,20 +4698,20 @@ func (b *executorBuilder) getCacheTable(tblInfo *model.TableInfo, startTS uint64
b.ctx.GetSessionVars().StmtCtx.ReadFromTableCache = true
return cacheData
}
go func() {
defer func() {
if r := recover(); r != nil {
logutil.BgLogger().Error("panic in the recoverable goroutine",
zap.Reflect("r", r),
zap.Stack("stack trace"))
}
}()
if !b.ctx.GetSessionVars().StmtCtx.InExplainStmt && !b.inDeleteStmt && !b.inUpdateStmt {
if !b.ctx.GetSessionVars().StmtCtx.InExplainStmt && !b.inDeleteStmt && !b.inUpdateStmt {
go func() {
defer func() {
if r := recover(); r != nil {
logutil.BgLogger().Error("panic in the recoverable goroutine",
zap.Reflect("r", r),
zap.Stack("stack trace"))
}
}()
err := tbl.(table.CachedTable).UpdateLockForRead(b.ctx.GetStore(), startTS)
if err != nil {
log.Warn("Update Lock Info Error")
}
}
}()
}()
}
return nil
}

0 comments on commit 3487bb7

Please sign in to comment.