Upgrading to 2.0.5 causes "nil can't be coerced into Float"
shepmaster opened this issue · 5 comments
I'm not sure if this is an issue with the gem or with our usage of it, but upon updating, our application no longer allowed people to log in. I figured I can open this here in case other people see something similar.
The changes in #37 seem relevant, but I'm going to try and do a bit more digging.
Here is the tail of the stacktrace:
connection_pool (2.2.2) lib/connection_pool/timed_stack.rb:77:in `+'
connection_pool (2.2.2) lib/connection_pool/timed_stack.rb:77:in `pop'
connection_pool (2.2.2) lib/connection_pool.rb:93:in `checkout'
connection_pool (2.2.2) lib/connection_pool.rb:62:in `block in with'
connection_pool (2.2.2) lib/connection_pool.rb:61:in `handle_interrupt'
connection_pool (2.2.2) lib/connection_pool.rb:61:in `with'
redis-rack (2.0.5) lib/redis/rack/connection.rb:16:in `with'
redis-rack (2.0.5) lib/rack/session/redis.rb:79:in `with'
redis-rack (2.0.5) lib/rack/session/redis.rb:38:in `block in get_session'
redis-rack (2.0.5) lib/rack/session/redis.rb:67:in `with_lock'
redis-rack (2.0.5) lib/rack/session/redis.rb:37:in `get_session'
rack (2.0.6) lib/rack/session/abstract/id.rb:425:in `find_session'
rack (2.0.6) lib/rack/session/abstract/id.rb:280:in `load_session'
actionpack (5.2.1) lib/action_dispatch/middleware/session/abstract_store.rb:46:in `block in load_session'
actionpack (5.2.1) lib/action_dispatch/middleware/session/abstract_store.rb:54:in `stale_session_check!'
actionpack (5.2.1) lib/action_dispatch/middleware/session/abstract_store.rb:46:in `load_session'
actionpack (5.2.1) lib/action_dispatch/request/session.rb:221:in `load!'
actionpack (5.2.1) lib/action_dispatch/request/session.rb:213:in `load_for_read!'
actionpack (5.2.1) lib/action_dispatch/request/session.rb:92:in `[]'
warden (1.2.7) lib/warden/session_serializer.rb:31:in `fetch'
warden (1.2.7) lib/warden/proxy.rb:213:in `user'
warden (1.2.7) lib/warden/proxy.rb:323:in `_perform_authentication'
warden (1.2.7) lib/warden/proxy.rb:105:in `authenticate'
warden (1.2.7) lib/warden/proxy.rb:115:in `authenticate?'
devise (4.5.0) lib/devise/rails/routes.rb:479:in `block in constraints_for'
Indeed, the timeout argument is nil
:
pool_options
# => {:size=>4, :timeout=>nil}
Which then causes issues with connection_pool
I think it might come from PR 27:
Old
pool_options[:timeout] = options[:pool_timeout] if options[:pool_timeout]
New
def pool_options
{
size: @options[:pool_size],
timeout: @options[:pool_timeout]
}
end
Notably, the if
check is missing.
Yup, this definitely has to do with my refactoring changes in order to make the #initialize
method a little less hairy. :) Looks like test coverage for this feature wasn't as fleshed out as I thought it was.
sorry this took so long, it's been released. as v2.0.6