Skip to content
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

Fix Timeout interrupt handling on Ruby 2.3 and protect Mysql2::Statement#execute #679

Merged
merged 1 commit into from
Sep 14, 2015

Conversation

sodabrew
Copy link
Collaborator

@sodabrew sodabrew commented Sep 9, 2015

Timeout::ExitException was removed in Ruby 2.3.0, 2.2.3, and 2.1.8, in favor of Timeout::Error. Backwards compatible aliases are provided for Ruby 2.1.x and 2.2.x, but not earlier verions.

With thanks to @jeremy for PR #671 and @yui-knk for PR #677, this commit also protects prepared statements from being interrupted, so the compat shim is in Mysql2::Util.

@sodabrew sodabrew added this to the 0.4.1 milestone Sep 9, 2015
@sodabrew sodabrew force-pushed the timeout_error branch 5 times, most recently from c74e58a to c232699 Compare September 13, 2015 06:06
@sodabrew
Copy link
Collaborator Author

This is causing Ruby 1.9.3 to sometimes segfault right after the execute is timed out, which is probably because 1.9.3 isn't actually protecting against the timeout (no Thread#handle_interrupt) and once the statement handle is invalid mysqlclient is fragile (as seen while debugging #673). I would solve this by actually skipping that test if Thread#handle_interrupt is not available and commenting about it.

This is also causing Rubinius to segfault at the end of all of the tests, and I'm less sure of what's going on there.

…ent#execute

Timeout::ExitException was removed in Ruby 2.3.0, 2.2.3, and 2.1.8,
in favor of Timeout::Error. Backwards compatible aliases are provided
for Ruby 2.1.x and 2.2.x, but not earlier verions.

With thanks to @jeremy for PR brianmario#671 and @yui-knk for PR brianmario#677, this commit
also protects prepared statements from being interrupted, so the compat
shim is in Mysql2::Util.
sodabrew added a commit that referenced this pull request Sep 14, 2015
Fix Timeout interrupt handling on Ruby 2.3 and protect Mysql2::Statement#execute
@sodabrew sodabrew merged commit f9b59d0 into brianmario:master Sep 14, 2015
@sodabrew sodabrew deleted the timeout_error branch September 14, 2015 04:35
@sodabrew sodabrew mentioned this pull request May 8, 2016
sodabrew added a commit that referenced this pull request May 8, 2016
Resolve #731 with cherry-picked commits from #592 and #679.
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.

None yet

1 participant