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

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


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

commit eaf0345b9a953d096b55b2038e7fc5aaaa6dc596
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 470cf46..4946ea2 100644
--- a/java/org/apache/tomcat/util/net/AprEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AprEndpoint.java
@@ -1933,7 +1933,9 @@ public class AprEndpoint extends AbstractEndpoint<Long> 
implements SNICallBack {
                     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 09e4f1c..d323076 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -55,6 +55,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