You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ja...@apache.org on 2022/10/20 07:54:38 UTC
[solr] branch main updated: SOLR-16463: Workaround for serious crash on JDK17+ (#1090)
This is an automated email from the ASF dual-hosted git repository.
janhoy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/main by this push:
new 49f03a6a74d SOLR-16463: Workaround for serious crash on JDK17+ (#1090)
49f03a6a74d is described below
commit 49f03a6a74df843d5301d41c72ff60db97f694e1
Author: Jan Høydahl <ja...@users.noreply.github.com>
AuthorDate: Thu Oct 20 09:54:32 2022 +0200
SOLR-16463: Workaround for serious crash on JDK17+ (#1090)
---
solr/CHANGES.txt | 2 ++
solr/bin/solr | 6 ++++++
solr/bin/solr.cmd | 6 ++++++
3 files changed, 14 insertions(+)
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 8e8007e79ff..6eb4a5ceeeb 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -246,6 +246,8 @@ Bug Fixes
* SOLR-16453: Overseer doesn't handle PRS and non-PRS messages properly (Justin Sweeney, Hitesh Khamesra)
+* SOLR-16463: Workaround for serious crash on JDK17+ due to JIT on caffeinecache (janhoy, Uwe Schindler)
+
Other Changes
---------------------
* SOLR-16351: Upgrade Carrot2 to 4.4.3, upgrade randomizedtesting to 2.8.0. (Dawid Weiss)
diff --git a/solr/bin/solr b/solr/bin/solr
index 03465b4151f..06ec0727d85 100755
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -2239,6 +2239,12 @@ function start_solr() {
exit 1
fi
+ # Workaround for JIT crash, see https://issues.apache.org/jira/browse/SOLR-16463
+ if [[ "$JAVA_VER_NUM" -ge "17" ]] ; then
+ SOLR_OPTS+=("-XX:CompileCommand=exclude,com.github.benmanes.caffeine.cache.BoundedLocalCache::put")
+ echo "Java $JAVA_VER_NUM detected. Enabled workaround for SOLR-16463"
+ fi
+
SOLR_START_OPTS=('-server' "${JAVA_MEM_OPTS[@]}" "${GC_TUNE[@]}" "${GC_LOG_OPTS[@]}" "${IP_ACL_OPTS[@]}" \
"${REMOTE_JMX_OPTS[@]}" "${CLOUD_MODE_OPTS[@]}" ${SOLR_LOG_LEVEL_OPT:-} -Dsolr.log.dir="$SOLR_LOGS_DIR" \
"-Djetty.port=$SOLR_PORT" "-DSTOP.PORT=$stop_port" "-DSTOP.KEY=$STOP_KEY" \
diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmd
index 800061a7020..b243f1ad6b7 100755
--- a/solr/bin/solr.cmd
+++ b/solr/bin/solr.cmd
@@ -1247,6 +1247,12 @@ IF "%GC_TUNE%"=="" (
-XX:+ExplicitGCInvokesConcurrent
)
+REM Workaround for JIT crash, see https://issues.apache.org/jira/browse/SOLR-16463
+if !JAVA_MAJOR_VERSION! GEQ 17 (
+ set SOLR_OPTS=%SOLR_OPTS% -XX:CompileCommand=exclude,com.github.benmanes.caffeine.cache.BoundedLocalCache::put
+ echo Java %JAVA_MAJOR_VERSION% detected. Enabled workaround for SOLR-16463
+)
+
if !JAVA_MAJOR_VERSION! GEQ 9 if NOT "%JAVA_VENDOR%" == "OpenJ9" (
IF NOT "%GC_LOG_OPTS%"=="" (
echo ERROR: On Java 9 you cannot set GC_LOG_OPTS, only default GC logging is available. Exiting