Tag 8.0.19

git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc8.0.x/tags/TOMCAT_8_0_19@1659844 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/build.xml b/build.xml
index f5aa2ec..8ee5cb3 100644
--- a/build.xml
+++ b/build.xml
@@ -1341,6 +1341,35 @@
 
   <target name="test" description="Runs the JUnit test cases"
           depends="test-bio,test-nio,test-nio2,test-apr,cobertura-report" >
+    <fileset id="test.result.skippedtests" dir="${test.reports}" includes="*.txt">
+      <not>
+        <contains text="Skipped: 0" />
+      </not>
+    </fileset>
+    <fileset id="test.result.failedtests" dir="${test.reports}" includes="*.txt">
+      <not>
+        <contains text="Failures: 0, Errors: 0" />
+      </not>
+    </fileset>
+    <concat>
+      <header>Testsuites with skipped tests:${line.separator}</header>
+      <string>${toString:test.result.skippedtests}</string>
+      <filterchain>
+        <tokenfilter>
+          <replaceregex pattern=";" replace="${line.separator}"/>
+        </tokenfilter>
+      </filterchain>
+    </concat>
+    <concat>
+      <header>Testsuites with failed tests:${line.separator}</header>
+      <string>${toString:test.result.failedtests}</string>
+      <filterchain>
+        <tokenfilter>
+          <replaceregex pattern=";" replace="${line.separator}"/>
+        </tokenfilter>
+      </filterchain>
+    </concat>
+
     <fail if="test.result.error" message='Some tests completed with an Error. See ${tomcat.build}/logs for details, search for "FAILED".' />
     <fail if="test.result.failure" message='Some tests completed with a Failure. See ${tomcat.build}/logs for details, search for "FAILED".' />
   </target>
diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java b/java/org/apache/tomcat/util/net/AprEndpoint.java
index af5f74c..36ea443 100644
--- a/java/org/apache/tomcat/util/net/AprEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AprEndpoint.java
@@ -1661,7 +1661,15 @@
                             maintain();
                         }
                         synchronized (this) {
-                            this.wait(10000);
+                            // Make sure that no sockets have been placed in the
+                            // addList or closeList since the check above.
+                            // Without this check there could be a 10s pause
+                            // with no processing since the notify() call in
+                            // add()/close() would have no effect since it
+                            // happened before this sync block was entered
+                            if (addList.size() < 1 && closeList.size() < 1) {
+                                this.wait(10000);
+                            }
                         }
                     } catch (InterruptedException e) {
                         // Ignore
@@ -1679,25 +1687,25 @@
                 try {
                     // Duplicate the add and remove lists so that the syncs are
                     // minimised
-                    if (closeList.size() > 0) {
-                        synchronized (this) {
+                    synchronized (this) {
+                        if (closeList.size() > 0) {
                             // Duplicate to another list, so that the syncing is
                             // minimal
                             closeList.duplicate(localCloseList);
                             closeList.clear();
+                        } else {
+                            localCloseList.clear();
                         }
-                    } else {
-                        localCloseList.clear();
                     }
-                    if (addList.size() > 0) {
-                        synchronized (this) {
+                    synchronized (this) {
+                        if (addList.size() > 0) {
                             // Duplicate to another list, so that the syncing is
                             // minimal
                             addList.duplicate(localAddList);
                             addList.clear();
+                        } else {
+                            localAddList.clear();
                         }
-                    } else {
-                        localAddList.clear();
                     }
 
                     // Remove sockets
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index c217b4d..bab833d 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -135,6 +135,11 @@
         improve the quality of values provided for the
         <code>javax.servlet.request.key_size</code> request attribute. (markt)
       </update>
+      <fix>
+        Fix a concurrency issue in the APR Poller that meant it was possible
+        under low load for a socket queued to be added to the Poller not to be
+        added for 10 seconds. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Jasper">
@@ -227,6 +232,10 @@
         <bug>57558</bug>: Add missing JAR in Ant task definition required by
         the validate task. (markt)
       </fix>
+      <add>
+        List names of Testsuites that have failed or skipped tests when
+        running the tests with Ant. (kkolinko)
+      </add>
     </changelog>
   </subsection>
 </section>