Author: markt Date: Sun Feb 15 09:47:58 2015 New Revision: 1659907 URL: http://svn.apache.org/r1659907 Log: Make timeout volatile because it is written on a different thread than it is read on within a single request.
Modified: tomcat/tc8.0.x/trunk/java/org/apache/tomcat/util/net/SocketWrapper.java tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml Modified: tomcat/tc8.0.x/trunk/java/org/apache/tomcat/util/net/SocketWrapper.java URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/tomcat/util/net/SocketWrapper.java?rev=1659907&r1=1659906&r2=1659907&view=diff ============================================================================== --- tomcat/tc8.0.x/trunk/java/org/apache/tomcat/util/net/SocketWrapper.java (original) +++ tomcat/tc8.0.x/trunk/java/org/apache/tomcat/util/net/SocketWrapper.java Sun Feb 15 09:47:58 2015 @@ -27,8 +27,11 @@ public class SocketWrapper<E> { private volatile E socket; + // Volatile because I/O and setting the timeout values occurs on a different + // thread to the thread checking the timeout. private volatile long lastAccess = System.currentTimeMillis(); - private long timeout = -1; + private volatile long timeout = -1; + private boolean error = false; private volatile int keepAliveLeft = 100; private volatile boolean comet = false; Modified: tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml?rev=1659907&r1=1659906&r2=1659907&view=diff ============================================================================== --- tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml Sun Feb 15 09:47:58 2015 @@ -45,6 +45,15 @@ issues to not "pop up" wrt. others). --> <section name="Tomcat 8.0.20 (markt)" rtext="in development"> + <subsection name="Coyote"> + <changelog> + <fix> + Fix a concurrency issue that meant that a change in socket timeout (e.g. + when switching to asynchronous I/O) did not always take effect + immediately. (markt) + </fix> + </changelog> + </subsection> </section> <section name="Tomcat 8.0.19 (markt)" rtext="not released"> <subsection name="Catalina"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org