Skip to content

Commit

Permalink
release all locks on session end (#1569)
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifersp authored Jan 31, 2023
1 parent a7e02ba commit 642c208
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion server/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,17 @@ func (h *Handler) ConnectionClosed(c *mysql.Conn) {
h.sm.CloseConn(c)
return
}

_, err = h.e.LS.ReleaseAll(ctx)
if err != nil {
logrus.Errorf("unable to release all locks on session close: %s", err)
}

h.sm.CloseConn(c)

// If connection was closed, kill its associated queries.
ctx.ProcessList.Kill(c.ConnectionID)
if err := h.e.Analyzer.Catalog.UnlockTables(ctx, c.ConnectionID); err != nil {
if err = h.e.Analyzer.Catalog.UnlockTables(ctx, c.ConnectionID); err != nil {
logrus.Errorf("unable to unlock tables on session close: %s", err)
}

Expand Down

0 comments on commit 642c208

Please sign in to comment.