Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8260366

ExtendedSocketOptions <clinit> can deadlock in some circumstances

    XMLWordPrintable

Details

    • b12
    • Not verified

    Description

      A DESCRIPTION OF THE PROBLEM :
      sun.net.ext.ExtendedSocketOptions and jdk.net.ExtendedSocketOptions reference each other in their <clinit> methods. If they both get initialized at the same time by different threads a deadlock can result.

      https://github.com/openjdk/jdk/blob/master/src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java#L234
      https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/sun/net/ext/ExtendedSocketOptions.java#L184

      We have observed this while starting MongoDB on Windows in our CI environment as seen here: https://github.com/quarkusio/quarkus/issues/14424#issuecomment-764977031


      CUSTOMER SUBMITTED WORKAROUND :
      Force initialization in a single thread during app startup.

      Attachments

        Issue Links

          Activity

            People

              michaelm Michael McMahon
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: