rails: Freeze when receive multiple requests quickly

Steps to reproduce

  1. Start rails app (with puma)
  2. Make multiple request at same time. More specifically, when my android activity destroys, 3 fragments tries to get same resource from the server.
  3. Rails app freezes. ctrl-c, ctrl-d does not work at all.
=> Booting Puma
=> Rails 5.1.4 application starting in development
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.11.0 (ruby 2.5.0-p0), codename: Love Song
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop


Started GET "/v4/keywords/current" for 192.168.0.5 at 2018-02-22 20:41:13 +0900
Started GET "/v4/keywords/current" for 192.168.0.5 at 2018-02-22 20:41:13 +0900
Started GET "/v4/keywords/current" for 192.168.0.5 at 2018-02-22 20:41:13 +0900



^C^C^C^C^D


System configuration

Rails version: 5.1.4 Ruby version: 2.5.0

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 14
  • Comments: 16 (7 by maintainers)

Commits related to this issue

Most upvoted comments

I’m also getting this issue in development when config.eager_load = false. Setting to true “fixes”, but I don’t think should be regarded as the solution. Can anyone shed some light on this? Also getting the undefined contant issues that @mu29 reported.

I’m still seeing this with: ruby 2.5.3p105 (2018-10-18 revision 65156) Rails 5.2.1

The config.eager_load = true workaround seems to be working for me in development but something is definitely broken when config.eager_load = false. I think this should be re-opened.

I fixed this by removing wrap_parameters

Solved by using eager_load = false. Thanks all! 😃

I also encountered this issue. There are always some threads stuck at: https://github.com/rails/rails/blob/5-1-stable/activerecord/lib/active_record/model_schema.rb#L461

The issue appears for me when testing with RSpec, using RSpec.config.use_transactional_fixtures = true and Rails.configuration.eager_load = false. Flipping eager_load to true is a workaround.