Skip to content

Drop mysql2 version less than 0.4.3 to guarantee fork safety - #31244

Merged
kamipo merged 1 commit into
rails:masterfrom
kamipo:drop_older_mysql2_version
Nov 27, 2017
Merged

kamipo merged 1 commit into
rails:masterfrom
kamipo:drop_older_mysql2_version

Conversation

@kamipo

@kamipo kamipo commented Nov 27, 2017

Copy link
Copy Markdown
Member

Since #31173, mysql2 adapter depends on automatic_close which is
introduced since mysql2 0.4.3. So the adapter with the mysql2 version
before doesn't work with fork now.

% ARCONN=mysql2 be ruby -w -Itest test/cases/connection_adapters/connection_handler_test.rb -n test_forked_child_doesnt_mangle_parent_connection
Using mysql2
Run options: -n test_forked_child_doesnt_mangle_parent_connection --seed 19988

/Users/kamipo/src/github.com/rails/rails/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb:108:in `discard!': undefined method `automatic_close=' for #<Mysql2::Client:0x00007fedaa91dfd0> (NoMethodError)

This drops mysql2 version less than 0.4.3 to guarantee fork safety.

Since rails#31173, mysql2 adapter depends on `automatic_close` which is
introduced since mysql2 0.4.3. So the adapter with the mysql2 version
before doesn't work with fork now.

```
% ARCONN=mysql2 be ruby -w -Itest test/cases/connection_adapters/connection_handler_test.rb -n test_forked_child_doesnt_mangle_parent_connection
Using mysql2
Run options: -n test_forked_child_doesnt_mangle_parent_connection --seed 19988

/Users/kamipo/src/github.com/rails/rails/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb:108:in `discard!': undefined method `automatic_close=' for #<Mysql2::Client:0x00007fedaa91dfd0> (NoMethodError)
```

This drops mysql2 version less than 0.4.3 to guarantee fork safety.
@kamipo
kamipo merged commit 924a368 into rails:master Nov 27, 2017
@kamipo
kamipo deleted the drop_older_mysql2_version branch November 27, 2017 20:09
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