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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
     new ef60783  SpotBugs warnings. Log problems stopping acceptor threads
ef60783 is described below

commit ef607838c853db88da12b88d15ab066494146e7e
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Oct 16 09:39:24 2020 +0100

    SpotBugs warnings. Log problems stopping acceptor threads
---
 java/org/apache/tomcat/util/net/Acceptor.java           | 6 ++++--
 java/org/apache/tomcat/util/net/LocalStrings.properties | 3 +++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/Acceptor.java 
b/java/org/apache/tomcat/util/net/Acceptor.java
index 9fa0818..2927b6f 100644
--- a/java/org/apache/tomcat/util/net/Acceptor.java
+++ b/java/org/apache/tomcat/util/net/Acceptor.java
@@ -159,9 +159,11 @@ public class Acceptor<U> implements Runnable {
     public void stop() {
         stopCalled = true;
         try {
-            stopLatch.await(10, TimeUnit.SECONDS);
+            if (!stopLatch.await(10, TimeUnit.SECONDS)) {
+               log.warn(sm.getString("acceptor.stop.fail", getThreadName()));
+            }
         } catch (InterruptedException e) {
-            // Ignore
+            log.warn(sm.getString("acceptor.stop.interrupted", 
getThreadName()), e);
         }
     }
 
diff --git a/java/org/apache/tomcat/util/net/LocalStrings.properties 
b/java/org/apache/tomcat/util/net/LocalStrings.properties
index 43b740c..10daeb0 100644
--- a/java/org/apache/tomcat/util/net/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/net/LocalStrings.properties
@@ -13,6 +13,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+acceptor.stop.fail= The acceptor thread [{0}] did not stop cleanly
+acceptor.stop.interrupted=Interrupt was received while waiting for the 
acceptor thread [{0}] to stop
+
 channel.nio.interrupted=The current thread was interrupted
 channel.nio.ssl.appInputNotEmpty=Application input buffer still contains data. 
Data would have been lost.
 channel.nio.ssl.appOutputNotEmpty=Application output buffer still contains 
data. Data would have been lost.


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

Reply via email to