Expect 100-continue errors

Eric Wong normalperson at yhbt.net
Wed Dec 9 17:16:09 EST 2009

Jan Dvorak <jan.dvorak at kraxnet.cz> wrote:
> Hello,
> i'm trying to implement handling of http Expect: 100-continue with
> unicorn in my rails app, but when i return [100] as a response (which
> should force unicorn to return 100 status and rerun my app with the same
> connection) i get this error:
> Read error: #<ThreadError: stopping only thread
>     note: use sleep to stop forever>
> /var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/reloader.rb:31:in
> `lock'

Hi Jan,

Try disabling automatic code reloading under Rails development mode.

Unicorn (and Rainbows!) are the only Ruby servers I know of that allow
Rack applications to properly return and continue with 100 responses.

Unicorn calls your Rack app twice in this case: it sees a 100 response,
writes the 100-continue response and then does app.call(env) again after
deleting the "Expect: 100-continue" header from env.

I haven't tested this under Rails so I don't know how well it works with
what Rails does under the covers, but I've done this heavily with bare
Rack applications.

Eric Wong

More information about the mongrel-unicorn mailing list