Skip to content
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

false positive in checking connection liveness #963

Closed
lrita opened this issue May 7, 2019 · 3 comments · Fixed by #964
Closed

false positive in checking connection liveness #963

lrita opened this issue May 7, 2019 · 3 comments · Fixed by #964

Comments

@lrita
Copy link

lrita commented May 7, 2019

Issue description

Tell us what should happen and what happens instead

#934

When I update this package version to d0a5481, it alway show follow error log. After a simple investigation, I think there should using SyscallConn.Control instead of SyscallConn.Read in connCheck. If there is no data in the socket, we maybe got a reading-timeout error when driver do a connection liveness checking by using SyscallConn.Read. @vmg , do you think so? Thanks.

Example code

dsn: 

charset=utf8&parseTime=True&loc=Local&timeout=1s&writeTimeout=3s&readTimeout=3s

Error log

the package always logging:

closing bad idle connection: raw-read tcp xxx.xxx.xxx.xx->xxx.xxx.xxx.xx: i/o timeout

Configuration

Driver version (or git SHA):
d0a5481
Go version:
go1.12.4
Server version:
MySQL 5.5.31
Server OS:
Centos 7.0

@vmg
Copy link
Contributor

vmg commented May 7, 2019

Hiii @lrita! Thanks for the report! I think I've spotted the issue -- could you try out #964 to see if it fixes your problem?

@lrita
Copy link
Author

lrita commented May 7, 2019

After testing, this patch works fine. Clear the read-timeout flag of connection by SetReadDeadline is fine also. Good job.

@vmg
Copy link
Contributor

vmg commented May 7, 2019

🙇

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

Successfully merging a pull request may close this issue.

2 participants