https://issues.apache.org/bugzilla/show_bug.cgi?id=45661

           Summary: NioBlockingSelector uses all CPU after a socket
                    connection is killed
           Product: Tomcat 6
           Version: 6.0.18
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


I have an app which runs an embedded Tomcat with nio connector.
Using Sysinternals TcpView to close an socket connection to a localhost port,
the process spikes to high CPU usage.

After I pause the threads, I find out the NioBlockingSelector.BlockPoller is
causing the high CPU. In this code fragment, the selector.select(1000) returns
without waiting for 1000ms, but the keyCount is zero.

I don't know why selector.select(1000) returns immediately in this case. Maybe
it is bug in Java, but could this function be changed to prevent the looping in
this case?

        public void run() {
            while (run) {
                try {
                    events();
                    int keyCount = 0;
                    try {
                        int i = wakeupCounter.get();
                        if (i>0) 
                            keyCount = selector.selectNow();
                        else {
                            wakeupCounter.set(-1);
                            keyCount = selector.select(1000);
                        }


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to