Alexey Petrushin
2009-Jul-08 17:27 UTC
[Mongrel] Why Mongrel doesn''t cancel connection on error?
Why Mongrel doesn''t cancel connection on error? Example: (Mongrel using Rack) ... def call env begin p :start sleep 10 ensure p :stop end end ... Open browser, go to localhost:8080, and immediatelly close the browser. Output will be: start <waits for 10 sec> end Why it doesn''t cancel/kill thread immediatelly? -- Posted via http://www.ruby-forum.com/.
Eric Wong
2009-Jul-08 23:51 UTC
[Mongrel] Why Mongrel doesn''t cancel connection on error?
Alexey Petrushin <lists at ruby-forum.com> wrote:> Why Mongrel doesn''t cancel connection on error? > > Example: (Mongrel using Rack) > > ... > def call env > begin > p :start > sleep 10 > ensure > p :stop > end > end > ... > > Open browser, go to localhost:8080, and immediatelly close the browser. > Output will be: > > start > <waits for 10 sec> > end > > Why it doesn''t cancel/kill thread immediatelly?Because it''s not commonly needed and it''s extra overhead which punishes applications that respond quickly anyways. You''re not the first person to want it and I proposed a (still untested) solution in this thread here: http://groups.google.com/group/rack-devel/browse_thread/thread/5e5b52892f5e9353 -- Eric Wong