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

Upgrading to 2.0.5 causes "nil can't be coerced into Float" #44

Closed
shepmaster opened this issue Nov 12, 2018 · 5 comments
Closed

Upgrading to 2.0.5 causes "nil can't be coerced into Float" #44

shepmaster opened this issue Nov 12, 2018 · 5 comments

Comments

@shepmaster
Copy link
Contributor

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.

@shepmaster
Copy link
Contributor Author

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'

@shepmaster
Copy link
Contributor Author

Indeed, the timeout argument is nil:

pool_options
# => {:size=>4, :timeout=>nil}

Which then causes issues with connection_pool

@shepmaster
Copy link
Contributor Author

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.

@tubbo
Copy link
Contributor

tubbo commented Nov 14, 2018

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.

shepmaster added a commit to shepmaster/redis-rack that referenced this issue Dec 12, 2018
shepmaster added a commit to shepmaster/redis-rack that referenced this issue Dec 19, 2018
shepmaster added a commit to shepmaster/redis-rack that referenced this issue Dec 19, 2018
@tubbo tubbo closed this as completed in #45 Dec 19, 2018
@tubbo
Copy link
Contributor

tubbo commented Sep 18, 2019

sorry this took so long, it's been released. as v2.0.6

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

No branches or pull requests

2 participants