Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


'mysqlplus' blocks the entire Ruby process when connecting to DB #3

ibc opened this Issue · 3 comments

2 participants


Hi, "mysqlplus" (and of course also "mysql") driver blocks totally the Ruby process when it's trying to connect to a MySQL server. In case the server doesn't respond then we get our Tuby application stopped forever.

Please check the following code which shows the issue:

Is it possible to make MySQL connection non-blocking?



I've reported same bug for 'pg' driver and it's fixed now (it already implemented non-blocking connection):


To create a non-blocking connection you need to provide a timeout (works in all mysql libs) as by default there is no connect timeout defined.
con = Mysql.init
con.options(Mysql::OPT_CONNECT_TIMEOUT, 5) # 5 second timeout


Great, I didn't know such option. I will report to Sequel developer to include it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.