Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] JVM Bug

Tony,

there are several NIO bugs that snoracle have decided not to fix
in JVM 1.6 (the fact that they are mostly only on linux I'm sure has
nothing to do with this decision).

The effect of these bugs is that a select may return immediately
without any connections selected.  This results in a busy loop
within the acceptor thread.

There are a number of work arounds that were developed by us,
tomcat, mina and other NIO using projects that suffer from these.

They start with cancelling some types of select keys and recreating
them.  If that fails, we need to discard the entire select set and
make a new one.   If that fails, we inject small delays (50ms) into
the acceptor thread to at least prevent the busy loop.
We also have an option to detect a particular busy connection and
to close it (this is off by default)


This behaviour is controlled by the following system properties:

    private static final int __JVMBUG_THRESHHOLD=Integer.getInteger("org.mortbay.io.nio.JVMBUG_THRESHHOLD",512).intValue();
    private static final int __MONITOR_PERIOD=Integer.getInteger("org.mortbay.io.nio.MONITOR_PERIOD",1000).intValue();
    private static final int __MAX_SELECTS=Integer.getInteger("org.mortbay.io.nio.MAX_SELECTS",15000).intValue();
    private static final int __BUSY_PAUSE=Integer.getInteger("org.mortbay.io.nio.BUSY_PAUSE",50).intValue();
    private static final int __BUSY_KEY=Integer.getInteger("org.mortbay.io.nio.BUSY_KEY",-1).intValue();


If you don't want these work arounds, set org.mortbay.io.nio.JVMBUG_THRESHHOLD
to a large int (say max int).

Now, you say your server does not work at all?!?!?!
I don't believe these features would be related to that.

So hello world doesn't even work for you?


PS. I will write this up in a wiki page.


Tony Thompson wrote:
> I am using Jetty 7 and I am seeing this:
> 
> 2010-02-08
> 16:58:57.932:INFO::org.eclipse.jetty.io.nio.SelectorManager$SelectSet@651ee017
> Busy selector - injecting delay 2 times
> 2010-02-08
> 16:58:57.932:INFO::org.eclipse.jetty.io.nio.SelectorManager$SelectSet@651ee017
> JVM BUG(s) - injecting delay3 times
> 
> 
> Can anyone explain what this is and how I might be able to avoid it? 
> The server does not work at all so whatever the Jetty code is doing
> doesn't seem to make any difference.
> 
> Thanks for the info.
> Tony
>  
> This message (and any associated files) is intended only for the
> use of the individual or entity to which it is addressed and may
> contain information that is confidential, subject to copyright or
> constitutes a trade secret. If you are not the intended recipient
> you are hereby notified that any dissemination, copying or
> distribution of this message, or files associated with this message,
> is strictly prohibited. If you have received this message in error,
> please notify us immediately by replying to the message and deleting
> it from your computer. Messages sent to and from Stoneware, Inc.
> may be monitored.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> jetty-users mailing list
> jetty-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jetty-users



Back to the top