Skip to content

Commit e8357f6

Browse files
vitess-bot[bot]vitess-bot
authored andcommitted
Online DDL: fix defer function, potential connection pool exhaustion (#17207)
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
1 parent cc51ed8 commit e8357f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

go/vt/vttablet/onlineddl/executor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,13 +963,13 @@ func (e *Executor) cutOverVReplMigration(ctx context.Context, s *VReplStream, sh
963963
if err != nil {
964964
return err
965965
}
966+
defer lockConn.Recycle()
966967
// Set large enough `@@lock_wait_timeout` so that it does not interfere with the cut-over operation.
967968
// The code will ensure everything that needs to be terminated by `migrationCutOverThreshold` will be terminated.
968969
lockConnRestoreLockWaitTimeout, err := e.initConnectionLockWaitTimeout(ctx, lockConn.Conn, 5*migrationCutOverThreshold)
969970
if err != nil {
970971
return err
971972
}
972-
defer lockConn.Recycle()
973973
defer lockConnRestoreLockWaitTimeout()
974974
defer lockConn.Conn.Exec(ctx, sqlUnlockTables, 1, false)
975975

0 commit comments

Comments
 (0)