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

Puma and rack-timeout results in a null pointer after running for some time #202

Open
gillesbergerp opened this issue May 9, 2023 · 1 comment

Comments

@gillesbergerp
Copy link

We recently tried introducing request timeouts for our Rails application using this gem. While this setup works for some time, we run into a null pointer exception at some point:

NoMethodError: undefined method `state=' for nil:NilClass
  _set_state! at /usr/local/bundle/gems/rack-timeout-0.6.3/lib/rack/timeout/core.rb:193
  call at /usr/local/bundle/gems/rack-timeout-0.6.3/lib/rack/timeout/core.rb:123
  call at /usr/local/bundle/gems/rack-timeout-0.6.3/lib/rack/timeout/core.rb:125
  run! at /usr/local/bundle/gems/rack-timeout-0.6.3/lib/rack/timeout/support/scheduler.rb:39
  run! at /usr/local/bundle/gems/rack-timeout-0.6.3/lib/rack/timeout/support/scheduler.rb:52
  run_loop! at /usr/local/bundle/gems/rack-timeout-0.6.3/lib/rack/timeout/support/scheduler.rb:100
  each at org/jruby/RubyArray.java:1865
  run_loop! at /usr/local/bundle/gems/rack-timeout-0.6.3/lib/rack/timeout/support/scheduler.rb:100
  loop at org/jruby/RubyKernel.java:1507
  run_loop! at /usr/local/bundle/gems/rack-timeout-0.6.3/lib/rack/timeout/support/scheduler.rb:81
  runner at /usr/local/bundle/gems/rack-timeout-0.6.3/lib/rack/timeout/support/scheduler.rb:73

So it appears that the env either no longer holds the state or never held it in the first place.

Our setup is as follows:

  • JRuby 9.3.4.0
  • Rails 6.1.7.2
  • Puma 6.2.1

Any help would be very much appreciated

@gillesbergerp gillesbergerp changed the title Ouma and rack-timeout results in a null pointer after running for some time Puma and rack-timeout results in a null pointer after running for some time May 9, 2023
@wuputah
Copy link
Collaborator

wuputah commented May 15, 2024

Hmm, this looks like some kind of threading-related bug, possibly one that isn't seen in CRuby due to the GIL. Would have to review the logic and design more carefully to get to the bottom of this one.

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