-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GG-36475 Fix the illegal reflective access warnings issue #3070
base: master
Are you sure you want to change the base?
Changes from all commits
2543845
b7386ce
3311898
6f3416b
51bb31e
0f58a07
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,164 +1,97 @@ | ||
#!/usr/bin/env bash | ||
if [ ! -z "${IGNITE_SCRIPT_STRICT_MODE:-}" ] | ||
then | ||
if [ ! -z "${IGNITE_SCRIPT_STRICT_MODE:-}" ]; then | ||
set -o nounset | ||
set -o errexit | ||
set -o pipefail | ||
set -o errtrace | ||
set -o functrace | ||
fi | ||
|
||
# | ||
# Copyright 2019 GridGain Systems, Inc. and Contributors. | ||
# | ||
# Licensed under the GridGain Community Edition License (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.gridgain.com/products/software/community-edition/gridgain-community-edition-license | ||
# | ||
# https://www.gridgain.com/products/software/community-edition/gridgain-community-edition-license | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
# | ||
# Grid cluster control. | ||
# | ||
|
||
# | ||
# Import common functions. | ||
# | ||
if [ "${IGNITE_HOME:-}" = "" ]; | ||
then IGNITE_HOME_TMP="$(dirname "$(cd "$(dirname "$0")"; "pwd")")"; | ||
else IGNITE_HOME_TMP=${IGNITE_HOME}; | ||
if [ "${IGNITE_HOME:-}" = "" ]; then | ||
IGNITE_HOME_TMP="$(dirname "$(cd "$(dirname "$0")"; pwd)")" | ||
else | ||
IGNITE_HOME_TMP=${IGNITE_HOME} | ||
fi | ||
|
||
# | ||
# Set SCRIPTS_HOME - base path to scripts. | ||
# | ||
SCRIPTS_HOME="${IGNITE_HOME_TMP}/bin" | ||
. "${SCRIPTS_HOME}/include/functions.sh" | ||
. "${SCRIPTS_HOME}/include/jvmdefaults.sh" || exit 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please clarify why we need |
||
|
||
source "${SCRIPTS_HOME}"/include/functions.sh | ||
source "${SCRIPTS_HOME}"/include/jvmdefaults.sh | ||
|
||
# | ||
# Discover path to Java executable and check it's version. | ||
# | ||
# Discover path to Java executable and check its version. | ||
checkJava | ||
|
||
# | ||
# Determine Java version function | ||
determineJavaVersion() { | ||
local version_output=$(java -version 2>&1) | ||
local version=$(echo "$version_output" | awk -F '"' '/version/ {print $2}' | awk -F '.' '{if ($1 == 1) {print $2} else {print $1}}') | ||
echo $version | ||
} | ||
JAVA_VERSION=$(determineJavaVersion) # Ensure this function is implemented correctly to fetch Java version | ||
|
||
# Discover IGNITE_HOME environment variable. | ||
# | ||
setIgniteHome | ||
|
||
if [ "${DEFAULT_CONFIG:-}" == "" ]; then | ||
DEFAULT_CONFIG=config/default-config.xml | ||
fi | ||
|
||
# | ||
# Set IGNITE_LIBS. | ||
# | ||
. "${SCRIPTS_HOME}"/include/setenv.sh | ||
. "${SCRIPTS_HOME}"/include/build-classpath.sh # Will be removed in the binary release. | ||
. "${SCRIPTS_HOME}/include/setenv.sh" | ||
CP="${IGNITE_LIBS}:${IGNITE_HOME}/libs/optional/ignite-zookeeper/*" | ||
|
||
RANDOM_NUMBER=$("$JAVA" -cp "${CP}" org.apache.ignite.startup.cmdline.CommandLineRandomNumberGenerator) | ||
|
||
# Mac OS specific support to display correct name in the dock. | ||
osname=`uname` | ||
|
||
osname=$(uname) | ||
if [ "${DOCK_OPTS:-}" == "" ]; then | ||
DOCK_OPTS="-Xdock:name=Ignite Node" | ||
fi | ||
|
||
# | ||
# JVM options. See http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp for more details. | ||
# | ||
# ADD YOUR/CHANGE ADDITIONAL OPTIONS HERE | ||
# | ||
if [ -z "${CONTROL_JVM_OPTS:-}" ] ; then | ||
if [[ `"$JAVA" -version 2>&1 | egrep "1\.[7]\."` ]]; then | ||
CONTROL_JVM_OPTS="-Xms256m -Xmx1g" | ||
else | ||
CONTROL_JVM_OPTS="-Xms256m -Xmx1g" | ||
fi | ||
fi | ||
|
||
# | ||
# Uncomment to enable experimental commands [--wal] | ||
# | ||
# CONTROL_JVM_OPTS="${CONTROL_JVM_OPTS} -DIGNITE_ENABLE_EXPERIMENTAL_COMMAND=true" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think, there is no need to remove this commented option(s) from the script. It might be useful. If the user wants to use the option, it is only required to uncomment just one line. At least the following options seem useful to me: |
||
|
||
# | ||
# Uncomment the following GC settings if you see spikes in your throughput due to Garbage Collection. | ||
# | ||
# CONTROL_JVM_OPTS="$CONTROL_JVM_OPTS -XX:+UseG1GC" | ||
|
||
# | ||
# Uncomment if you get StackOverflowError. | ||
# On 64 bit systems this value can be larger, e.g. -Xss16m | ||
# | ||
# CONTROL_JVM_OPTS="${CONTROL_JVM_OPTS} -Xss4m" | ||
|
||
# | ||
# Uncomment to set preference for IPv4 stack. | ||
# | ||
# CONTROL_JVM_OPTS="${CONTROL_JVM_OPTS} -Djava.net.preferIPv4Stack=true" | ||
|
||
# | ||
# Assertions are disabled by default since version 3.5. | ||
# If you want to enable them - set 'ENABLE_ASSERTIONS' flag to '1'. | ||
# | ||
ENABLE_ASSERTIONS="1" | ||
|
||
# | ||
# Set '-ea' options if assertions are enabled. | ||
# | ||
|
||
# Set JVM options with dynamic version check | ||
CONTROL_JVM_OPTS=$(getJavaSpecificOpts $JAVA_VERSION "$CONTROL_JVM_OPTS") | ||
CONTROL_JVM_OPTS+=" --illegal-access=warn" | ||
CONTROL_JVM_OPTS+=" --add-opens=java.base/java.nio=ALL-UNNAMED" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this mean that |
||
CONTROL_JVM_OPTS+=" --add-opens=java.base/sun.nio.ch=ALL-UNNAMED" | ||
|
||
# Enable assertions if set. | ||
if [ "${ENABLE_ASSERTIONS:-}" = "1" ]; then | ||
CONTROL_JVM_OPTS="${CONTROL_JVM_OPTS} -ea" | ||
# CONTROL_JVM_OPTS="${CONTROL_JVM_OPTS} -ea" | ||
CONTROL_JVM_OPTS+=" -ea" | ||
fi | ||
|
||
# | ||
# Set main class to start service (grid node by default). | ||
# | ||
if [ "${MAIN_CLASS:-}" = "" ]; then | ||
MAIN_CLASS=org.apache.ignite.internal.commandline.CommandHandler | ||
fi | ||
|
||
# | ||
# Remote debugging (JPDA). | ||
# Uncomment and change if remote debugging is required. | ||
# | ||
# CONTROL_JVM_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8787 ${CONTROL_JVM_OPTS}" | ||
|
||
# | ||
# Final CONTROL_JVM_OPTS for Java 9+ compatibility | ||
# | ||
CONTROL_JVM_OPTS=$(getJavaSpecificOpts $version "$CONTROL_JVM_OPTS") | ||
|
||
if [ -n "${JVM_OPTS}" ] ; then | ||
echo "JVM_OPTS environment variable is set, but will not be used. To pass JVM options use CONTROL_JVM_OPTS" | ||
echo "JVM_OPTS=${JVM_OPTS}" | ||
fi | ||
|
||
# Execute Java command based on OS | ||
case $osname in | ||
Darwin*) | ||
"$JAVA" ${CONTROL_JVM_OPTS} ${QUIET:-} "${DOCK_OPTS}" \ | ||
-DIGNITE_UPDATE_NOTIFIER=false -DIGNITE_HOME="${IGNITE_HOME}" \ | ||
"$JAVA" ${CONTROL_JVM_OPTS} ${QUIET:-} "${DOCK_OPTS}" -DIGNITE_HOME="${IGNITE_HOME}" \ | ||
-DIGNITE_PROG_NAME="$0" ${JVM_XOPTS:-} -cp "${CP}" ${MAIN_CLASS} "$@" | ||
;; | ||
;; | ||
OS/390*) | ||
"$JAVA" ${CONTROL_JVM_OPTS} ${QUIET:-} \ | ||
-DIGNITE_UPDATE_NOTIFIER=false -DIGNITE_HOME="${IGNITE_HOME}" \ | ||
$(getIbmSslOpts $version) \ | ||
-DIGNITE_PROG_NAME="$0" ${JVM_XOPTS:-} -cp "${CP}" ${MAIN_CLASS} "$@" | ||
;; | ||
"$JAVA" ${CONTROL_JVM_OPTS} ${QUIET:-} -DIGNITE_UPDATE_NOTIFIER=false -DIGNITE_HOME="${IGNITE_HOME}" \ | ||
$(getIbmSslOpts $JAVA_VERSION) -DIGNITE_PROG_NAME="$0" ${JVM_XOPTS:-} -cp "${CP}" ${MAIN_CLASS} "$@" | ||
;; | ||
*) | ||
"$JAVA" ${CONTROL_JVM_OPTS} ${QUIET:-} \ | ||
-DIGNITE_UPDATE_NOTIFIER=false -DIGNITE_HOME="${IGNITE_HOME}" \ | ||
"$JAVA" ${CONTROL_JVM_OPTS} ${QUIET:-} -DIGNITE_HOME="${IGNITE_HOME}" \ | ||
-DIGNITE_PROG_NAME="$0" ${JVM_XOPTS:-} -cp "${CP}" ${MAIN_CLASS} "$@" | ||
;; | ||
;; | ||
esac |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about this change. This is our standard license that is used everywhere. Anyway, it is up to you. The license check looks OK https://ggtc.gridgain.com/buildConfiguration/GridGain8_Test_SanityCheck_Licenses?branch=gg-36475&buildTypeTab=overview&mode=builds#all-projects