Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-16463

Serious crash on JDK17+ due to JIT on caffeinecache

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 9.0
    • 9.1
    • Docker
    • None

    Description

      Solr 9+ under JDK 17+ may crash frequently, during JVM Hotspot optimization of caffeine cache class.

      This is due to a JDK bug (https://bugs.openjdk.org/browse/JDK-8285835), but may not be fixed soon in JDK17, so we should make a workaround to protect our users. The bug is also reported in caffeine project (https://github.com/ben-manes/caffeine/issues/797).

      So there are a few possible ways to avoid this

      • Run Solr 9 on JDK 11
      • Do not use caffeine cache, find some replacement
      • Caffeine cache releases a new version that do not suffer the issue, and solr uses that
      • Instruct JDK to not optimize that class, using JDK option 
        -XX:CompileCommand=exclude,com.github.benmanes.caffeine.cache.BoundedLocalCache::put

      See users list for examples of this issue seen in the wild: https://lists.apache.org/thread/wg7qtkddd1t5h08okj7gm9qbrpdf0ox6 

      Docker users can set SOLR_OPTS with the JDK option above. Patching the official Dockerfile to include this may be the least intrusive fix short-term. We should also document the issue on website and perhaps docker hub to provide users with a workaround.

      For 9.1 we can hardcode the JDK flag in bin/solr.

      Attachments

        1. SOLR-16463.patch
          4 kB
          Shawn Heisey

        Issue Links

          Activity

            People

              janhoy Jan Høydahl
              janhoy Jan Høydahl
              Votes:
              1 Vote for this issue
              Watchers:
              15 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 4.5h
                  4.5h