bitflicker64 commented on code in PR #3253:
URL: https://github.com/apache/hugegraph/pull/3253#discussion_r4540660176


##########
hugegraph-store/hg-store-node/src/test/java/org/apache/hugegraph/store/node/listener/PdConfigureListenerYamlTest.java:
##########
@@ -88,6 +88,117 @@ public void testBootStartsWithShippedYamlConfiguration() {
         }
     }
 
+    @Test
+    public void testResolveConfigFilePathFollowsSpringConfigLocation() throws 
Exception {

Review Comment:
   Important: `pd-store-ci.yml` runs `hg-store-node` tests only through 
`-Dtest=StoredRowIngressTest,ArthasSecurityTest,HgStoreMetricsControllerTest`, 
so these new `resolveConfigFilePath` tests never run in CI. Add 
`PdConfigureListenerYamlTest` to that `-Dtest` list.



##########
hugegraph-server/hugegraph-dist/src/assembly/static/bin/hugegraph-server.sh:
##########
@@ -250,7 +280,19 @@ if [ "${OPEN_TELEMETRY}" == "true" ]; then
     # Note: check carefully if multi "javeagent" params are set
     # Append, so the operator's JAVA_TOOL_OPTIONS stays; the crash-file 
defaults
     # are put in front of all of it below.
-    export JAVA_TOOL_OPTIONS="${JAVA_TOOL_OPTIONS:+${JAVA_TOOL_OPTIONS} 
}-javaagent:${PLUGINS}/${OT_JAR}"
+    # The JVM splits JAVA_TOOL_OPTIONS on whitespace, so an overridden $PLUGINS
+    # containing a space would turn the agent option into two arguments and 
fail
+    # the launch. The JVM does honour quoted options, so wrap the option in a
+    # quote character the path itself does not contain.
+    if [[ ${OT_JAR_PATH} != *"'"* ]]; then
+        AGENT_QUOTE="'"
+    elif [[ ${OT_JAR_PATH} != *\"* ]]; then
+        AGENT_QUOTE='"'
+    else
+        report_error "## Error: ${OT_JAR_PATH} contains both quote characters, 
which JAVA_TOOL_OPTIONS cannot carry."
+        exit 1
+    fi
+    export JAVA_TOOL_OPTIONS="${JAVA_TOOL_OPTIONS:+${JAVA_TOOL_OPTIONS} 
}${AGENT_QUOTE}-javaagent:${OT_JAR_PATH}${AGENT_QUOTE}"

Review Comment:
   Important: wrapping the agent option in quotes breaks the check at line 982 
of `test-java-security-properties.sh`, which expects an unquoted 
`-javaagent:...jar` at the end of `JAVA_TOOL_OPTIONS`, so the `server-rocksdb` 
job fails at this head and its later steps, including the new shell tests, 
never run. Update that assertion to accept the quoted form, for example `=~ \ 
\'-javaagent:[^\']*/opentelemetry-javaagent\.jar\'$`.



##########
docs/server-runtime.md:
##########
@@ -54,6 +54,51 @@ bootstrap before Server accepts Gremlin requests. This does 
not initialize the p
 for every future Store target. Unit checks that obtain a stub verify lazy pool
 construction; a successful RPC and its readback are separate runtime checks.
 
+### Launcher path overrides
+
+`bin/start-hugegraph.sh` accepts four path overrides. The override flags also 
work in
+`bin/init-store.sh` (`-c`/`-o`), `bin/stop-hugegraph.sh` (`-i`) and the monitor
+cron job installed by `-m true`, so stop/restart/monitor stay consistent with
+the paths `bin/start-hugegraph.sh` used.
+
+| Flag | Meaning | Default (when omitted) |
+|---|---|---|
+| `-c <dir>` | Conf directory | `$TOP/conf` |
+| `-l <dir>` | Logs directory | `$TOP/logs` |
+| `-i <file>` | PID file | `$BIN/pid` |
+| `-o <dir>` | Plugins directory | `$TOP/plugins` |
+
+`$TOP` is the distribution's install root (the parent of `bin/`); `$BIN` is
+`$TOP/bin`.
+
+Relative values are resolved to absolute paths before use: `-l` and `-o` name
+directories the launcher writes into, so a relative or missing directory is
+created; `-c` is only ever read, so a relative value is resolved without
+creating anything, and a missing `-c` directory is a startup error. `-i`'s
+parent directory is created by `start-hugegraph.sh` (and `init-store.sh`),

Review Comment:
   Minor: `init-store.sh` accepts only `-c` and `-o`, so it never creates the 
`-i` parent directory. Drop `(and init-store.sh)` from this sentence.



-- 
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]

Reply via email to