Skip to content

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
@methane methane modified the milestones: v1.9.0, v1.10.0 Feb 20, 2025
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