Author: markt Date: Wed Jun 1 21:27:14 2016 New Revision: 1746499 URL: http://svn.apache.org/viewvc?rev=1746499&view=rev Log: status -> event Simplify. The endpoint.warn.noExector was added to handle Comet related issues on connector stop so is no longer required.
Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java tomcat/trunk/java/org/apache/tomcat/util/net/LocalStrings.properties Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=1746499&r1=1746498&r2=1746499&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Wed Jun 1 21:27:14 2016 @@ -798,49 +798,30 @@ public class AprEndpoint extends Abstrac * Process the given socket. Typically keep alive or upgraded protocol. * * @param socket The socket to process - * @param status The current status of the socket + * @param event The event to process * * @return <code>true</code> if the processing completed normally otherwise * <code>false</code> which indicates an error occurred and that the * socket should be closed */ - public boolean processSocket(long socket, SocketEvent status) { - try { - Executor executor = getExecutor(); - if (executor == null) { - log.warn(sm.getString("endpoint.warn.noExector", - Long.valueOf(socket), null)); - } else { - SocketWrapperBase<Long> wrapper = - connections.get(Long.valueOf(socket)); - // Make sure connection hasn't been closed - if (wrapper != null) { - executor.execute(new SocketProcessor(wrapper, status)); - } - } - } catch (RejectedExecutionException x) { - log.warn("Socket processing request was rejected for:"+socket,x); - return false; - } catch (Throwable t) { - ExceptionUtils.handleThrowable(t); - // This means we got an OOM or similar creating a thread, or that - // the pool and its queue are full - log.error(sm.getString("endpoint.process.fail"), t); - return false; + public boolean processSocket(long socket, SocketEvent event) { + SocketWrapperBase<Long> socketWrapper = connections.get(Long.valueOf(socket)); + if (socketWrapper != null) { + return processSocket(socketWrapper, event, true); } return true; } @Override - public boolean processSocket(SocketWrapperBase<Long> socket, SocketEvent status, + public boolean processSocket(SocketWrapperBase<Long> socket, SocketEvent event, boolean dispatch) { try { // Synchronisation is required here as this code may be called as a // result of calling AsyncContext.dispatch() from a non-container // thread synchronized (socket) { - SocketProcessor proc = new SocketProcessor(socket, status); + SocketProcessor proc = new SocketProcessor(socket, event); Executor executor = getExecutor(); if (dispatch && executor != null) { executor.execute(proc); Modified: tomcat/trunk/java/org/apache/tomcat/util/net/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/LocalStrings.properties?rev=1746499&r1=1746498&r2=1746499&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/net/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/tomcat/util/net/LocalStrings.properties Wed Jun 1 21:27:14 2016 @@ -17,7 +17,6 @@ endpoint.err.close=Caught exception trying to close socket endpoint.err.handshake=Handshake failed endpoint.err.unexpected=Unexpected error processing socket -endpoint.warn.noExector=Failed to process socket [{0}] in state [{1}] because the executor had already been shutdown endpoint.warn.unlockAcceptorFailed=Acceptor thread [{0}] failed to unlock. Forcing hard socket shutdown. endpoint.warn.executorShutdown=The executor associated with thread pool [{0}] has not fully shutdown. Some application threads may still be running. endpoint.warn.noRemoteAddr=Unable to determine remote address for socket [{0}] --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org