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

conncheck: use unix.Poll instead of syscall.Read #1456

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

methane
Copy link
Member

@methane methane commented Jul 6, 2023

Description

connCheck() now uses Poll() to check netConn readability.
When some event is happened, try reading from the connection and log error as much as possible.

Fix #1392

Checklist

  • Code compiles correctly
  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the README / documentation, if necessary
  • Added myself / the copyright holder to the AUTHORS file

@coveralls
Copy link

coveralls commented Jul 6, 2023

Coverage Status

coverage: 82.55% (+0.02%) from 82.534% when pulling 77038d6 on methane:checkconn-poll into 5d4a831 on go-sql-driver:master.


var errUnexpectedRead = errors.New("unexpected read from socket")
"golang.org/x/sys/unix"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work on Windows?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it doesn't, as current implementation too.

@methane methane added this to the v1.9.0 milestone Mar 6, 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

Successfully merging this pull request may close these issues.

"closing bad idle connection: unexpected read from socket" errors on MySQL 8.0.24
3 participants