users@glassfish.java.net

Re: JRuby/Grizzly - Request Cancelation

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Thu, 22 Feb 2007 12:18:56 -0500

Hi Jacob,

Jacob Hookom wrote:
> http://www.jroller.com/page/obie?entry=expensive_operations_especially_dangerous_in
>
>
> Any leg up on this with JRuby on Glassfish/Grizzly?

I don't think Grizzly suffer that problem because when the connection is
closed, the NIO Selector will wakes up with an event. Any tentative to
write something on the Channel will throw an IOException. Of course if
the ruby app doesn't write anything, then I suspect the problem
described can potentially happens. But this can happen as well with a
Servlet based application that doesn't write anything but spin/block/sleep.

Fortunately, GlassFish have a mechanism [1] to prevent those spinning
application to produce DoS. I can't give an example of how to do it
(I've never used the mechanism) but I've implemented in Grizzly the
hooks a self management rule can call to interrupt a spinning thread.

Thanks

-- Jeanfrancois

[1] http://blogs.sun.com/technical/entry/self_management_rules




>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>