Skip to content

Fixed SetReadDeadline before connCheck #1299

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

Merged
merged 1 commit into from
Jan 10, 2022
Merged

Conversation

zjj
Copy link
Contributor

@zjj zjj commented Jan 8, 2022

there's no need to set conn's readline if CheckConnLiveness is false,
and the ReadTimeout shall works with rawConn.Read inside conncheck.

Description

don't do SetReadDeadline CheckConnLiveness is false,
and use readtimeout deadline for conncheck.

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

@zjj
Copy link
Contributor Author

zjj commented Jan 8, 2022

@julienschmidt @vmg

see also: #964 #1052
ref: 8056f2c and 6844171

@zjj zjj force-pushed the master branch 2 times, most recently from 9837d81 to 488faf7 Compare January 8, 2022 18:36
there's no need to set conn's readline if CheckConnLiveness is false,
and the ReadTimeout shall work with rawConn.Read inside conncheck.
buffer.fill will do SetReadDeadline if needed
@methane methane merged commit 0d7b91a into go-sql-driver:master Jan 10, 2022
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.

2 participants