imbajin commented on code in PR #3253:
URL: https://github.com/apache/hugegraph/pull/3253#discussion_r4216789227
##########
hugegraph-store/hg-store-dist/src/assembly/static/bin/start-hugegraph-store.sh:
##########
@@ -174,11 +186,11 @@ case "$GC_OPTION" in
-XX:+UnlockDiagnosticVMOptions
-XX:-ZProactive"
;;
*)
- echo "Unrecognized gc option: '$GC_OPTION', default use g1, options
only support 'ZGC' now" >> ${OUTPUT}
+ echo "Unrecognized gc option: '$GC_OPTION', default use g1, options
only support 'ZGC' now" >> "${OUTPUT}"
exit 1
esac
-JVM_OPTIONS="-Dlog4j.configurationFile=${CONF}/log4j2.xml
-Dfastjson.parser.safeMode=true
-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager"
+JVM_OPTIONS="-Dlog4j.configurationFile=${CONF}/log4j2.xml
-Dfastjson.parser.safeMode=true -Dlogging.config=${CONF}/log4j2.xml
-DLOG_PATH=${LOGS} -Dbolt.log.path=${LOGS} -Dlogging.path=${LOGS}
-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager"
Review Comment:
[P2] 覆盖路径中的空格仍会在启动 JVM 时被拆开
这里把 CONF/LOGS 拼入 JVM_OPTIONS 字符串,但后面的 exec 仍以未加引号的 ${JVM_OPTIONS} /
${JAVA_OPTIONS} 展开。普通安装目录下传入 -c '/data/external conf' 或 -l '/data/external
logs' 就会产生多余的独立参数;我在 e272e27 的 PD、Store、Server 原脚本中捕获到了单独的 conf/log4j2.xml /
logs 参数,再把捕获的 argv 交给 JDK 21,三个入口都以 “Could not find or load main class
conf.log4j2.xml” 退出。因此本次路径和重定向加引号后,PR 承诺支持的带空格目录仍无法启动。
请用数组保存脚本生成的 JVM 参数并逐项传给 Java,同时保留用户 Java options 的既定解析方式;Server 最后的配置文件参数和
classpath 也需要按一个参数传递。建议增加实际 launcher argv 的回归,而不只验证 canonicalize/cron helper。
##########
hugegraph-server/hugegraph-dist/src/assembly/static/bin/stop-monitor.sh:
##########
@@ -25,11 +25,15 @@ function abs_path() {
echo "$( cd -P "$( dirname "$SOURCE" )" && pwd )"
}
-BIN=`abs_path`
-TOP="$(cd $BIN/../ && pwd)"
+BIN="$(abs_path)"
+TOP="$(cd "$BIN"/../ && pwd)"
-. $BIN/util.sh
+. "$BIN"/util.sh
-CRONTAB_JOB="$TOP/bin/monitor-hugegraph.sh"
+# Must equal the serialized form start-monitor.sh saved (one quoted shell
word),
+# otherwise grep -F cannot match a path containing an apostrophe or space and
the
+# job could never be removed. shell_quote (not cron_quote) so removal is not
+# blocked by validation.
+CRONTAB_JOB="$(shell_quote "$TOP/bin/monitor-hugegraph.sh")"
Review Comment:
[P2] 删除监控任务时也需要兼容升级前写入的 cron 格式
新的删除 key 始终带外层单引号,但旧版 start-monitor.sh 写入的是未加引号的
$TOP/bin/monitor-hugegraph.sh。原地升级并保留已有 crontab 后,两种文本不会匹配,crontab_remove
却会返回成功。我用 base 版本的真实 start-monitor.sh 和当前 stop-monitor.sh 配合临时 crontab 复现:stop
返回 0,旧监控行仍存在;如果先运行新的 start-monitor.sh,还会生成同一路径的第二条任务,stop 只删除新行。
这会让 stop-hugegraph.sh 报告监控已关闭,但旧 cron
任务仍可能在下一分钟重新启动服务。请在添加/删除时安全兼容或迁移旧格式,并增加“旧版生成 → 新版删除”的升级回归,保留现有带空格/单引号路径的测试。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]