Skip to content

Commit

Permalink
executor: add rollback in releaseSysSession (#14272)
Browse files Browse the repository at this point in the history
  • Loading branch information
sre-bot authored and coocood committed Dec 27, 2019
1 parent 6adce23 commit 8f13cf1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions executor/simple.go
Expand Up @@ -75,8 +75,15 @@ func (e *SimpleExec) getSysSession() (sessionctx.Context, error) {
}

func (e *SimpleExec) releaseSysSession(ctx sessionctx.Context) {
if ctx == nil {
return
}
dom := domain.GetDomain(e.ctx)
sysSessionPool := dom.SysSessionPool()
if _, err := ctx.(sqlexec.SQLExecutor).Execute(context.Background(), "rollback"); err != nil {
ctx.(pools.Resource).Close()
return
}
sysSessionPool.Put(ctx.(pools.Resource))
}

Expand Down

0 comments on commit 8f13cf1

Please sign in to comment.