This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/7.0.x by this push:
     new 6ca89dc  Correct concurrency issue in sendfile thread
6ca89dc is described below

commit 6ca89dc00795d6d6a4e45443aed52827656db8d6
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Apr 17 13:16:32 2019 +0100

    Correct concurrency issue in sendfile thread
    
    Identified by Coverity scan.
---
 java/org/apache/tomcat/util/net/AprEndpoint.java | 4 +++-
 webapps/docs/changelog.xml                       | 4 ++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java 
b/java/org/apache/tomcat/util/net/AprEndpoint.java
index b8d13d4..2e2324a 100644
--- a/java/org/apache/tomcat/util/net/AprEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AprEndpoint.java
@@ -2305,7 +2305,9 @@ public class AprEndpoint extends AbstractEndpoint<Long> {
                     maintainTime = 0;
                     try {
                         synchronized (this) {
-                            this.wait();
+                            if (sendfileRunning && sendfileCount < 1 && 
addS.size() < 1) {
+                                this.wait();
+                            }
                         }
                     } catch (InterruptedException e) {
                         // Ignore
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 416c250..907a9c9 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -69,6 +69,10 @@
         Fix a potential concurrency issue in the StringCache identifed by
         Coverity scan. (markt)
       </fix>
+      <fix>
+        Fix a potential concurrency issue in the main Sendfile thread of the 
APR
+        connector. Identified by Coverity scan. (markt)
+      </fix>
     </changelog>
   </subsection>
 </section>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to