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

ExtendedSocketOptions <clinit> can deadlock in some circumstances

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b12
    • Verification:
      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

        1. JDK8260366.java
          1 kB
          Jaikiran Pai
        2. jstack.txt
          8 kB
          Jaikiran Pai

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: