puma: Error reached top of thread-pool: EOFError (EOFError)

Frequently for us in dev, puma hits an error in its thread pool, grinding the web server to a halt. This happens on page refreshes on our Rails app. I’m making an issue out of desperation, but I have not a lot to go on.

It appears this block catches some kind of internal error, but no backtrace is attached for us:

https://github.com/puma/puma/blob/master/lib/puma/thread_pool.rb#L121

          begin
            block.call(work, *extra)
          rescue Exception => e
            STDERR.puts "Error reached top of thread-pool: #{e.message} (#{e.class})"
          end

After a few of those in the logs, we also sometimes see:

16:51:09 web.1 | Error in reactor loop escaped: undefined method join’ for nil:NilClass (NoMethodError)`

Does anyone have a hunch about where this might be coming from?

System configuration

Ruby version: 2.5.0 Rails version: 5.1.4 Puma version: 3.11.0

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 5
  • Comments: 18 (2 by maintainers)

Commits related to this issue

Most upvoted comments

I’m also seeing the same error reported by tuwukee on 3.11.4

2018-06-01 12:55:57 +0000: Read error: #<EOFError: EOFError>
/usr/local/bundle/gems/puma-3.11.3/lib/puma/client.rb:292:in `try_to_finish'
/usr/local/bundle/gems/puma-3.11.3/lib/puma/client.rb:106:in `reset'
/usr/local/bundle/gems/puma-3.11.3/lib/puma/server.rb:450:in `process_client'
/usr/local/bundle/gems/puma-3.11.3/lib/puma/server.rb:302:in `block in run'

Ruby 2.5.0 Rails 5.2.0

So I updated to 3.11.2 to fix this issue. While the issue log errors mentioned here no longer show up, I am now getting the following errors in the puma.log file with most HTTP requests (over SSL of course):

=== puma startup: 2018-02-01 08:00:55 -0500 === === puma startup: 2018-02-01 08:00:55 -0500 === Error reached top of thread-pool: EOFError (EOFError) Error reached top of thread-pool: EOFError (EOFError) Error reached top of thread-pool: EOFError (EOFError) Error reached top of thread-pool: EOFError (EOFError) Error reached top of thread-pool: EOFError (EOFError) Error reached top of thread-pool: EOFError (EOFError)Error reached top of thread-pool: EOFError (EOFError) Error reached top of thread-pool: EOFError (EOFError)

anyone have any idea what could be going on? I haven’t noticed any bad user experience yet (e.g. puma crash or http request hang)

Thanks, Rafael

Looks like the issue with EOFError is already fixed.

The code version where the EOFError error was reported to happen - source code. Currently any IO error is rescued and swallowed here source code.

This change was introduce in https://github.com/puma/puma/pull/1728 and released in v4.0.0 (Changelog)

Reopening until @tuwukee’s comment is addressed.