You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2012/03/23 10:56:35 UTC

svn commit: r1304255 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/tomcat/util/net/NioEndpoint.java java/org/apache/tomcat/util/net/res/LocalStrings.properties

Author: markt
Date: Fri Mar 23 09:56:35 2012
New Revision: 1304255

URL: http://svn.apache.org/viewvc?rev=1304255&view=rev
Log:
kkolinko review of r1304011: Always close selector
Additionally, ensure that an exception during the close does not prevent the poller loop from ending

Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
    tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1304253

Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=1304255&r1=1304254&r2=1304255&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Fri Mar 23 09:56:35 2012
@@ -1122,6 +1122,12 @@ public class NioEndpoint extends Abstrac
                     if (close) {
                         events();
                         timeout(0, false);
+                        try {
+                            selector.close();
+                        } catch (IOException ioe) {
+                            log.error(sm.getString(
+                                    "endpoint.nio.selectorCloseFail"), ioe);
+                        }
                         break;
                     } else {
                         hasEvents = events();
@@ -1140,7 +1146,12 @@ public class NioEndpoint extends Abstrac
                         if (close) {
                             events();
                             timeout(0, false);
-                            selector.close();
+                            try {
+                                selector.close();
+                            } catch (IOException ioe) {
+                                log.error(sm.getString(
+                                        "endpoint.nio.selectorCloseFail"), ioe);
+                            }
                             break;
                         }
                     } catch ( NullPointerException x ) {

Modified: tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties?rev=1304255&r1=1304254&r2=1304255&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/res/LocalStrings.properties Fri Mar 23 09:56:35 2012
@@ -47,3 +47,4 @@ endpoint.debug.channelCloseFail=Failed t
 endpoint.debug.socketCloseFail=Failed to close socket
 endpoint.apr.noSslCertFile=Connector attribute SSLCertificateFile must be defined when using SSL with APR
 endpoint.apr.invalidSslProtocol=An invalid value [{0}] was provided for the SSLProtocol attribute
+endpoint.nio.selectorCloseFail=Failed to close selector when closing the poller



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org