You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2019/03/15 13:55:54 UTC

[tomcat] branch master updated: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63251 JDK-8194653

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 6defc87  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63251 JDK-8194653
6defc87 is described below

commit 6defc879f55b3c8b9013b111efb90ee6668f8ec7
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Mar 15 13:55:35 2019 +0000

    Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63251 JDK-8194653
    
    Implement a work-around for a known JRE bug
    (https://bugs.openjdk.java.net/browse/JDK-8194653) that may cause a
    dead-lock when Tomcat starts.
---
 java/org/apache/juli/logging/LogFactory.java | 14 ++++++++++++++
 webapps/docs/changelog.xml                   |  5 +++++
 2 files changed, 19 insertions(+)

diff --git a/java/org/apache/juli/logging/LogFactory.java b/java/org/apache/juli/logging/LogFactory.java
index 3be213f..3cd4562 100644
--- a/java/org/apache/juli/logging/LogFactory.java
+++ b/java/org/apache/juli/logging/LogFactory.java
@@ -17,6 +17,7 @@
 package org.apache.juli.logging;
 
 import java.lang.reflect.Constructor;
+import java.nio.file.FileSystems;
 import java.util.ServiceLoader;
 import java.util.logging.LogManager;
 
@@ -70,6 +71,19 @@ public class LogFactory {
      * Private constructor that is not available for public use.
      */
     private LogFactory() {
+        /*
+         * Work-around known a JRE bug.
+         * https://bugs.openjdk.java.net/browse/JDK-8194653
+         *
+         * Pre-load the default file system. No performance impact as we need to
+         * load the default file system anyway. Just do it earlier to avoid the
+         * potential deadlock.
+         *
+         * This can be removed once the oldest JRE supported by Tomcat includes
+         * a fix.
+         */
+        FileSystems.getDefault();
+
         // Look via a ServiceLoader for a Log implementation that has a
         // constructor taking the String name.
         ServiceLoader<Log> logLoader = ServiceLoader.load(Log.class);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index c410f52..ecfb116 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -69,6 +69,11 @@
         target, return a file size of <code>-</code> rather than
         <code>1k</code>. (markt)
       </fix>
+      <fix>
+        <bug>63251</bug>: Implement a work-around for a known JRE bug (<a
+        href="https://bugs.openjdk.java.net/browse/JDK-8194653">JDK-8194653</a>)
+        that may cause a dead-lock when Tomcat starts. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Web applications">


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