Skip to content

Got an error reading communication packets #492

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
shaunglinux opened this issue Apr 15, 2020 · 2 comments
Closed

Got an error reading communication packets #492

shaunglinux opened this issue Apr 15, 2020 · 2 comments

Comments

@shaunglinux
Copy link

shaunglinux commented Apr 15, 2020

client package 每次调用 Close() 方法后查看数据库连接已关闭,但是mysql err log 日会有一条日志输出。Got an error reading communication packets

func (s *Server) Close() {
if s.conn != nil {
s.conn.Close()
}
}

截屏2020-04-15下午6 44 59

操作系统centos 7
MySQL 5.7.22 与 5.8
查看MySQL 配置
connect_timeout = 28800
interactive_timeout = 28800
wait_timeout = 28800
max_allowed_packet=256M

@shaunglinux
Copy link
Author

func (c *Conn) Close() error {
if err := c.writeCommandUint32(COM_QUIT, c.connectionID); err != nil {
return errors.Trace(err)
}
return c.Conn.Close()
}

修改了client package Close 方法 添加主动COM_QUIT
if err := c.writeCommandUint32(COM_QUIT, c.connectionID); err != nil {
return errors.Trace(err)
}

@dveeden
Copy link
Collaborator

dveeden commented Nov 7, 2024

Looks like this was fixed in 7263925 (from #787 )

@dveeden dveeden closed this as completed Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants