Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

database connection reaping may remove connection in use #9710

Closed
qianthinking opened this Issue · 7 comments

6 participants

@qianthinking

this commit 7cc588b add default reaping frequency and the reaping may remove connection in use

$ rails new temp
$ rails g model User name:string

lib/tasks/createusers.rake

namespace :test do
  desc "createusers"
  task :createusers => :environment do
    10000.times{User.new(name: "ok").save!}
  end
end
$ rake rake test:createusers

#error output for gem 'mysql2'

Mysql2::Error: MySQL server has gone away: INSERT ...
or
Mysql2::Error: Lost connection to MySQL server during query: INSERT ...

#error output for gem 'pg'

undefined method `fields' for nil:NilClass #query result is nil

@senny
Owner

confirmed. This commit breaks mysql2 tests on my machine. Mysql adapter works fine.

@vipulnsward

+1 not able to run any mysql2 tests. Only for a fashionable 30 frequency did the tests run for me.

@tenderlove
Owner

Crap, I totally forgot the test runner issue. I'll bump up this number in test.

@tenderlove
Owner

I've reverted the commit. :-D

@tenderlove tenderlove closed this
@senny
Owner

@tenderlove thanks for the revert :green_heart:

@ekosz

I'm using rails 4.0.0 with mysql2 and getting these errors still in my background workers.

undefined method `fields' for nil:NilClass
missing attribute: <random_column>
Mysql2::Error: MySQL server has gone away
Mysql2::Error: Lost connection to MySQL server during query

When the worker then goes to restart it works, so the issue is intermittent. Could this be related?

@ekosz ekosz referenced this issue in mperham/sidekiq
Closed

Workers freezing with fog gem #1179

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.