celluloid / reel

UNMAINTAINED: See celluloid/celluloid#779 - Celluloid::IO-powered web server
https://celluloid.io
MIT License
596 stars 87 forks source link

Actor crashed! Reel::StateError #164

Closed mighe closed 9 years ago

mighe commented 9 years ago

Hi @tarcieri , we dug deep to better understand this issue and we found that it is a Reel problem and not an Angelo one.

To reproduce it consistently run the following server:

require 'reel'

class MyServer < Reel::Server::HTTP

  def initialize(host = "127.0.0.1", port = 3000)
    super(host, port, &method(:on_connection))
  end

  def on_connection(connection)
    connection.each_request do |request|
      handle_request request
    end
  end

  def handle_request(request)
    resp = 'HELLO!!! ' * 10E6   # long response
    request.respond :ok, resp
  end

end

MyServer.run

As you can see we just respond with a very very long string. Try to connect to localhost:3000 with your browser or the wget command. When you let them download the entire body everything works correctly, but when you stop you process (quitting wget or clicking the X in the browser) Reel crashes with Reel::StateError: already processing a request.

It also happens with shorter responses, it is just harder to reproduce.

tarcieri commented 9 years ago

Seems related to #163

mighe commented 9 years ago

It seems fixed by #163 , can you release a new gem version? Thank you!

tarcieri commented 9 years ago

@digitalextremist I just made a Reel Core team and, umm, you're it for now :wink:

How do you feel about trying to release 0.6.0? Maybe make a 0.6.0.pre first?

digitalextremist commented 9 years ago

Roger that on taking over leadership on Reel, that's very comfortable for me.

I will audit where Reel stands and push toward shipping 0.6.0 possibly with a -pre first.

Will get back to you with more soon.

tarcieri commented 9 years ago

The first thing to do is probably go through the commit history and update the CHANGES.md with some high-level release notes about what's changed

digitalextremist commented 9 years ago

Well, looks like this is the only issue "blocking" 0.6.0 now, so once a2cec82 passes build under jRuby, I'll cut a gem @tarcieri. Probably under 72 hours unless the Server::HTTPS issue is really involved.

digitalextremist commented 9 years ago

Released in 0.6.0.pre1