Author: markt
Date: Wed Mar 28 20:48:41 2012
New Revision: 1306589
URL: http://svn.apache.org/viewvc?rev=1306589&view=rev
Log:
Fix intermittent JMX deregistration test failure.
Modified:
tomcat/tc7.0.x/trunk/ (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
Merged /tomcat/trunk:r1306579
Modified:
tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java?rev=1306589&r1=1306588&r2=1306589&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
Wed Mar 28 20:48:41 2012
@@ -470,6 +470,18 @@ public abstract class AbstractEndpoint {
* Unlock the server socket accept using a bogus connection.
*/
protected void unlockAccept() {
+ // Only try to unlock the acceptor if it is necessary
+ boolean unlockRequired = false;
+ for (Acceptor acceptor : acceptors) {
+ if (acceptor.getState() == AcceptorState.RUNNING) {
+ unlockRequired = true;
+ break;
+ }
+ }
+ if (!unlockRequired) {
+ return;
+ }
+
java.net.Socket s = null;
InetSocketAddress saddr = null;
try {
@@ -678,7 +690,7 @@ public abstract class AbstractEndpoint {
* example, this can happen with the Acceptor thread if the ulimit for open
* files is reached.
*
- * @param currentErrorDelay The current delay beign applied on failure
+ * @param currentErrorDelay The current delay being applied on failure
* @return The delay to apply on the next failure
*/
protected int handleExceptionWithDelay(int currentErrorDelay) {
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=1306589&r1=1306588&r2=1306589&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Wed Mar 28 20:48:41 2012
@@ -177,6 +177,11 @@
Include port number when known in connector name when loggin messages
from connectors that use automatic free port allocation. (markt)
</add>
+ <fix>
+ Don't try an unlock the acceptor thread if it is not locked. This is
+ unlikely to impact normal usage but it does fix some unit test issues.
+ (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]