Author: markt
Date: Wed Jul 9 10:24:49 2014
New Revision: 1609079
URL: http://svn.apache.org/r1609079
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56684
Add a workaround for a bug that should never happen along with some basic debug
logging.
Modified:
tomcat/tc7.0.x/trunk/ (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/LocalStrings.properties
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardServer.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
Merged /tomcat/trunk:r1608963,1609061
Modified:
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/LocalStrings.properties
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/LocalStrings.properties?rev=1609079&r1=1609078&r2=1609079&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/LocalStrings.properties
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/LocalStrings.properties
Wed Jul 9 10:24:49 2014
@@ -229,6 +229,7 @@ standardHost.warRequired=URL to web appl
standardHost.warURL=Invalid URL for web application archive: {0}
standardServer.onameFail=MBean name specified for Server [{0}] is not valid
standardServer.shutdownViaPort=A valid shutdown command was received via the
shutdown port. Stopping the Server instance.
+standardServer.accept.timeout=The socket listening for the shutdown command
experienced an unexpected timeout [{0}] milliseconds after the call to
accept(). Is this an instance of bug 56684?
standardService.connector.initFailed=Failed to initialize connector [{0}]
standardService.connector.destroyFailed=Failed to destroy connector [{0}]
standardService.connector.pauseFailed=Failed to pause connector [{0}]
Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardServer.java
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardServer.java?rev=1609079&r1=1609078&r2=1609079&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardServer.java
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/StandardServer.java Wed
Jul 9 10:24:49 2014
@@ -24,6 +24,7 @@ import java.io.InputStream;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
+import java.net.SocketTimeoutException;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLClassLoader;
@@ -447,10 +448,17 @@ public final class StandardServer extend
StringBuilder command = new StringBuilder();
try {
InputStream stream;
+ long acceptStartTime = System.currentTimeMillis();
try {
socket = serverSocket.accept();
socket.setSoTimeout(10 * 1000); // Ten seconds
stream = socket.getInputStream();
+ } catch (SocketTimeoutException ste) {
+ // This should never happen but bug 56684 suggests that
+ // it does.
+ log.warn(sm.getString("standardServer.accept.timeout",
+ Long.valueOf(System.currentTimeMillis() -
acceptStartTime)), ste);
+ continue;
} catch (AccessControlException ace) {
log.warn("StandardServer.accept security exception: "
+ ace.getMessage(), ace);
Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1609079&r1=1609078&r2=1609079&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Wed Jul 9 10:24:49 2014
@@ -141,6 +141,11 @@
value during a cross-context dispatch. (markt)
</fix>
<fix>
+ <bug>56684</bug>: Ensure that Tomcat does not shut down if the socket
+ waiting for the shutdown command experiences a
+ <code>SocketTimeoutException</code>. (markt)
+ </fix>
+ <fix>
When the current PathInfo is modified as a result of dispatching a
request, ensure that a call to
<code>HttpServletRequest.getPathTranslated()</code> returns a value
that
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]