Conversation

methane

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

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.

@methanemethane added this to the v1.9.0 milestone Mar 6, 2024
@methanemethane modified the milestones: v1.9.0, v1.10.0 Feb 20, 2025
Sign up for free to join this conversation on . Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

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