Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

Reel::Server shutdown does not handle IOError #212

Open
promix17 opened this issue Nov 27, 2015 · 5 comments
Open

Reel::Server shutdown does not handle IOError #212

promix17 opened this issue Nov 27, 2015 · 5 comments
Milestone

Comments

@promix17
Copy link

Reel::Server shutdown does not handle IOError

https://github.com/celluloid/reel/blob/master/lib/reel/server.rb

E, [2015-11-27T13:16:50.854783 #9223] ERROR -- : HttpServer finalizer crashed!
IOError: closed stream
/var/lib/gems/1.9.1/gems/reel-0.5.0/lib/reel/server.rb:34:in `shutdown'
/var/lib/gems/1.9.1/gems/celluloid-0.17.2/lib/celluloid/cell.rb:84:in `block in shutdown'
/var/lib/gems/1.9.1/gems/celluloid-0.17.2/lib/celluloid/cell.rb:76:in `block in task'
/var/lib/gems/1.9.1/gems/celluloid-0.17.2/lib/celluloid/actor.rb:339:in `block in task'
/var/lib/gems/1.9.1/gems/celluloid-0.17.2/lib/celluloid/task.rb:44:in `block in initialize'
/var/lib/gems/1.9.1/gems/celluloid-0.17.2/lib/celluloid/task/fibered.rb:14:in `block in create'

Example

require 'celluloid/autostart'
require 'reel'

class HttpServer < Reel::Server::HTTP
  def initialize(params={})
    params = {
      :host => '0.0.0.0',
      :port => 8080
    }.merge(params)
    host, port = params.values_at(:host, :port)
    super(host, port, &method(:on_connection))
  end

  def on_connection(connection)
    connection.each_request do |request|
      request.respond 503, 'Server error'
    end
  end
end

server = HttpServer.new(:port => 8081)
server.shutdown

Gems

celluloid (0.17.2, 0.16.0)
celluloid-dns (0.17.0, 0.0.1)
celluloid-essentials (0.20.5)
celluloid-extras (0.20.5)
celluloid-fsm (0.20.5)
celluloid-io (0.17.2, 0.16.2)
celluloid-pool (0.20.5)
celluloid-supervision (0.20.5)
@digitalextremist
Copy link
Member

I vaguely recall this one. Have you happened to try the 0.6.0-milestone branch?

@digitalextremist digitalextremist added this to the triage milestone Feb 16, 2016
@MidnightsFX
Copy link

Still seeing this with 6.1.

Initializing the reel server with super and a Reel::Server::HTTP class. Similar as to above.

E, [2017-01-31T11:48:17.635000 #64215] ERROR -- : CLEANUP CRASHED! IOError: closed stream org/nio4r/Selector.java:123:in 'deregister' org/nio4r/Monitor.java:154:in 'close' org/nio4r/Monitor.java:145:in 'close' /jruby-9.1.6.0/gems/celluloid-io-0.17.3/lib/celluloid/io/reactor.rb:52:in 'wait' /jruby-9.1.6.0/gems/celluloid-io-0.17.3/lib/celluloid/io/reactor.rb:21:in 'wait_readable' /jruby-9.1.6.0/gems/celluloid-io-0.17.3/lib/celluloid/io.rb:54:in 'wait_readable' /jruby-9.1.6.0/gems/celluloid-io-0.17.3/lib/celluloid/io/tcp_server.rb:36:in 'accept' /jruby-9.1.6.0/gems/reel-0.6.1/lib/reel/server.rb:38:in 'block in run' org/jruby/RubyKernel.java:1299:in 'loop' /jruby-9.1.6.0/gems/reel-0.6.1/lib/reel/server.rb:38:in 'run' org/jruby/RubyKernel.java:1811:in 'public_send' /jruby-9.1.6.0/gems/celluloid-0.17.3/lib/celluloid/calls.rb:28:in 'dispatch' /jruby-9.1.6.0/gems/celluloid-0.17.3/lib/celluloid/call/async.rb:7:in 'dispatch' /jruby-9.1.6.0/gems/celluloid-0.17.3/lib/celluloid/cell.rb:50:in 'block in dispatch' /jruby-9.1.6.0/gems/celluloid-0.17.3/lib/celluloid/cell.rb:76:in 'block in task' /jruby-9.1.6.0/gems/celluloid-0.17.3/lib/celluloid/actor.rb:339:in 'block in task' /jruby-9.1.6.0/gems/celluloid-0.17.3/lib/celluloid/task.rb:44:in 'block in initialize' /jruby-9.1.6.0/gems/celluloid-0.17.3/lib/celluloid/task/fibered.rb:14:in 'block in create'

Getting one error message on program exit for every time the server is shutdown.

chewi added a commit to yakara-ltd/reel that referenced this issue May 3, 2017
I'm not entirely sure that this rescue is in the right place but it
does fix the issue. I did try putting it in handle_connection first
but that was ineffective.
@chewi
Copy link

chewi commented May 3, 2017

I've submitted a fix.

@MidnightsFX
Copy link

Hey @chewi is there a build, or branch I can build to take a look at your fix?

@chewi
Copy link

chewi commented May 3, 2017

See #240.

chewi added a commit to yakara-ltd/reel that referenced this issue Apr 20, 2018
I'm not entirely sure that this rescue is in the right place but it
does fix the issue. I did try putting it in handle_connection first
but that was ineffective.
chewi added a commit to yakara-ltd/reel that referenced this issue May 1, 2018
I'm not entirely sure that this rescue is in the right place but it
does fix the issue. I did try putting it in handle_connection first
but that was ineffective.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants