Skip to content

read_timeout and write_timeout configuration settings. #372

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

Closed
wants to merge 1 commit into from

Conversation

chakrit
Copy link
Contributor

@chakrit chakrit commented Sep 25, 2015

When the server that's running MySQL ran out of disk space, the mysqld process will hold onto all connections while it waits for disk space to be freed. Unfortunately there is currently no way to timeout the connection in this situation with go-sql-driver/mysql.

The existing timeout parameter is only used during initial connection establishment (driver.go:65).This PR adds read_timeout and write_timeout settings to the DSN and enforce them using net.Conn.SetReadDeadline and net.Conn.SetWriteDeadline respectively.

Let me know what you guys think.

  • Code compiles correctly
  • Created tests, if possible
  • All tests pass

@methane
Copy link
Member

methane commented Dec 12, 2015

LGTM.

I prefer adding readTimeout and writeTimeout to buffer instead of adding cfg. But it's my personal taste.

@julienschmidt
Copy link
Member

Continued in #401

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants