You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following logic, conn.getCtx().GetSessionVars().InTxn() is only true for explictly transactions. Therefore, the DrainClients will not wait for auto-commit statements, and results in leaking locks.
// DrainClients drain all connections in drainWait.
// After drainWait duration, we kill all connections still not quit explicitly and wait for cancelWait.
func (s *Server) DrainClients(drainWait time.Duration, cancelWait time.Duration) {
...
go func() {
defer close(allDone)
for _, conn := range conns {
if !conn.getCtx().GetSessionVars().InTxn() {
continue
}
select {
case <-conn.quit:
case <-quitWaitingForConns:
return
}
}
}()
...
}
It'd be better to also wait for all auto-commit statements to finish 🤔 .
The text was updated successfully, but these errors were encountered:
Bug Report
In the following logic,
conn.getCtx().GetSessionVars().InTxn()
is only true for explictly transactions. Therefore, theDrainClients
will not wait for auto-commit statements, and results in leaking locks.It'd be better to also wait for all auto-commit statements to finish 🤔 .
The text was updated successfully, but these errors were encountered: