Hello. Makoto again. I was trying the example shown at http://rainbows.rubyforge.org/sunshowers/. It's working fine, but shows following stack trace when I either close connections ( webSocket.close, refreshing browser, or closing the tab). Is this a bug, or expected behavior so that I should simple rescue? Sunshowers::WebSocket::Quit: done processing WebSocket request /Library/Ruby/Gems/1.8/gems/sunshowers-0.2.0/lib/sunshowers/web_socket.rb:101:in `ws_quit!' config.ru:15 /Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/content_type.rb:17:in `call' /Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/content_type.rb:17:in `call' /Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/content_length.rb:13:in `call' /Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/lint.rb:47:in `_call' /Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/lint.rb:35:in `call' /Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/showexceptions.rb:24:in `call' /Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/commonlogger.rb:20:in `_call' /Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/commonlogger.rb:13:in `call' /Library/Ruby/Gems/1.8/gems/rainbows-0.90.0/lib/rainbows/base.rb:52:in `process_client' /Library/Ruby/Gems/1.8/gems/rainbows-0.90.0/lib/rainbows/thread_pool.rb:47:in `sync_worker' /Library/Ruby/Gems/1.8/gems/rainbows-0.90.0/lib/rainbows/thread_pool.rb:31:in `worker_loop' /Library/Ruby/Gems/1.8/gems/rainbows-0.90.0/lib/rainbows/thread_pool.rb:31:in `initialize' /Library/Ruby/Gems/1.8/gems/rainbows-0.90.0/lib/rainbows/thread_pool.rb:31:in `new' /Library/Ruby/Gems/1.8/gems/rainbows-0.90.0/lib/rainbows/thread_pool.rb:31:in `worker_loop' /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `map' /Library/Ruby/Gems/1.8/gems/rainbows-0.90.0/lib/rainbows/thread_pool.rb:30:in `each' /Library/Ruby/Gems/1.8/gems/rainbows-0.90.0/lib/rainbows/thread_pool.rb:30:in `map' /Library/Ruby/Gems/1.8/gems/rainbows-0.90.0/lib/rainbows/thread_pool.rb:30:in `worker_loop' /Library/Ruby/Gems/1.8/gems/unicorn-0.95.3/lib/unicorn.rb:531:in `spawn_missing_workers' /Library/Ruby/Gems/1.8/gems/unicorn-0.95.3/lib/unicorn.rb:531:in `fork' /Library/Ruby/Gems/1.8/gems/unicorn-0.95.3/lib/unicorn.rb:531:in `spawn_missing_workers' /Library/Ruby/Gems/1.8/gems/unicorn-0.95.3/lib/unicorn.rb:527:in `each' /Library/Ruby/Gems/1.8/gems/unicorn-0.95.3/lib/unicorn.rb:527:in `spawn_missing_workers' /Library/Ruby/Gems/1.8/gems/unicorn-0.95.3/lib/unicorn.rb:537:in `maintain_worker_count' /Library/Ruby/Gems/1.8/gems/unicorn-0.95.3/lib/unicorn.rb:215:in `start' /Library/Ruby/Gems/1.8/gems/rainbows-0.90.0/lib/rainbows.rb:58:in `run' /Library/Ruby/Gems/1.8/gems/rainbows-0.90.0/bin/rainbows:166 /usr/bin/rainbows:19:in `load' /usr/bin/rainbows:19 Thanks. Makoto
Makoto Inoue <inouemak@googlemail.com> wrote: > Hello. Makoto again. > > I was trying the example shown at > http://rainbows.rubyforge.org/sunshowers/. It's working fine, but > shows following stack trace when I either close connections ( > webSocket.close, refreshing browser, or closing the tab). > > Is this a bug, or expected behavior so that I should simple rescue? > > Sunshowers::WebSocket::Quit: done processing WebSocket request > /Library/Ruby/Gems/1.8/gems/sunshowers-0.2.0/lib/sunshowers/web_socket.rb:101:in > `ws_quit!' > config.ru:15 > /Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/content_type.rb:17:in `call' > /Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/content_type.rb:17:in `call' > /Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/content_length.rb:13:in `call' > /Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/lint.rb:47:in `_call' > /Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/lint.rb:35:in `call' > /Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/showexceptions.rb:24:in `call' Hi Makoto, What happens when you run your server with the "-E deployment" switch? The Rack::ShowExceptions middleware tries to rescue everything in sight, but using "-E deployment" (or "-E none") will disable loading the Rack::ShowExceptions middleware. Sunshowers currently raises an EOFError subclass, but I've considered a switch to use catch(:async)/throw(:async) like async_sinatra does. This will get around the current issues with exception printers like this one, but requires more server support... -- Eric Wong
> Hi Makoto, > > What happens when you run your server with the "-E deployment" switch? > > The Rack::ShowExceptions middleware tries to rescue everything in sight, > but using "-E deployment" (or "-E none") will disable loading the > Rack::ShowExceptions middleware. > > Sunshowers currently raises an EOFError subclass, but I've considered a > switch to use catch(:async)/throw(:async) like async_sinatra does. This > will get around the current issues with exception printers like this > one, but requires more server support... > > -- > Eric Wong > Hi, Eric. Thank you for your reply. Yes -E dployment and -E none are good. They don't raise error message any more. Makoto