diff --git a/script/driver/mysql.lua b/script/driver/mysql.lua index efd3329f..f2123314 100644 --- a/script/driver/mysql.lua +++ b/script/driver/mysql.lua @@ -116,7 +116,6 @@ function MysqlDB:check_alive() thread_mgr:entry(self:address(), function() local channel = makechan("check mysql") for _, sock in pairs(self.connections) do - sock:close() channel:push(function() return self:login(sock) end) @@ -137,6 +136,7 @@ function MysqlDB:login(socket) end local ok, res = self:auth(socket) if not ok then + socket:close() self:delive(socket) log_err("[MysqlDB][login] auth db(%s:%s:%s) auth failed! because: %s", ip, port, id, res) return false