AvanishShukla20 commented on PR #3253:
URL: https://github.com/apache/hugegraph/pull/3253#issuecomment-6301938776

   ## Implementation Summary (860ec0faef003fa2737a27c5fbbc0d6666bc0145)
   
   ### 1. Bash-array JVM launchers — Quoting fix
   - Updated `start-hugegraph-pd.sh`, `stop-hugegraph-pd.sh`, 
`start-hugegraph-store.sh`, and `restart-hugegraph-store.sh` to build JVM 
options using Bash arrays instead of a single interpolated string.
   - Added `test-launcher-argv.sh`, which runs the actual launchers against a 
stub `java` executable and verifies that each `-D...` option, classpath 
argument, and config-file argument is passed as exactly one argument.
   - Added a self-check that deliberately reproduces the old, broken 
unquoted-string implementation to verify that the regression test detects the 
issue.
   
   ### 2. `reject_relative_conf_path` — New util.sh function
   - Added `reject_relative_conf_path` to reject relative `graphs`, 
`verify-path`, and `license-path` values in configuration files when `-c` 
overrides the config path.
   
   ### 3. `ensure_file_readable` — New util.sh function
   - Added `ensure_file_readable` to the Server, PD, and Store `util.sh` files.
   - Validates that a potentially overridden `-c` configuration file exists 
(`-f`) and is readable (`-r`) before any `read_property` call.
   - Integrated into:
     - `start-hugegraph.sh`
     - `init-store.sh`
     - `start-hugegraph-pd.sh`
     - `start-hugegraph-store.sh`
   - **Remaining gap:** `monitor-hugegraph.sh` has only partial coverage. The 
audit confirms the CONF readability guard and empty-URL guard, but forwarding 
is covered only for `-l`, `-o`, and `-i`. Full guard coverage is still pending.
   
   ### 4. `canonicalize_dir` — Optional nocreate mode
   - Extended `canonicalize_dir` with an optional second argument:
     - Default mode: creates the directory.
     - `nocreate` mode: canonicalizes the path without creating the directory.
     - Applied nocreate handling to `-i` (PID file) through `canonicalize_file`.
   
   ### 5. Classpath validation for `-o`
   - Enabled classpath mode in `reject_unsafe_path` for `-o`, adding `:` to the 
rejected characters.
   - Prevents paths containing `:` from corrupting classpath entry boundaries 
when the plugins directory is included in the colon-separated `CLASSPATH` / 
`JAVA_TOOL_OPTIONS` string.
   - Kept `-c` and `-l` on `crlf` mode because they are consumed as individual 
`-D` values rather than colon-separated lists.
   
   ### 6. Shell test scripts moved out of the assembly
   - Moved the following scripts from `src/assembly/static/bin/` to 
`hugegraph-dist/src/test/shell/`:
     - `test-canonicalize.sh`
     - `test-cron-quote.sh`
     - `test-override-guards.sh`
     - `test-launcher-argv.sh`
   - Prevents these test-only scripts from being included in the release 
tarball's `bin/` directory through `assembly.xml`'s `<include>*</include>` rule.
   
   ### 7. `stop-hugegraph-pd.sh` — Timeout handling (F-3)
   - Updated the process-termination logic to match the Server/Store pattern:
     ```bash
     if kill_process_and_wait ...; then
         rm "$PID_FILE"
     else
         exit 1
     fi
     ```
   - Ensures a timed-out process termination returns a failure exit code 
instead of incorrectly falling through to exit code 0.
   
   ### 8. `test-override-guards.sh` — New regression test script
   - Added `test-override-guards.sh` under `hugegraph-dist/src/test/shell/`, 
covering end-to-end behavioural checks for the `-c`, `-l`, `-o`, and `-i` 
overrides across Server, PD, and Store start/stop/restart/init scripts.
   ---
   
   ### Monitor scripts fixes (tracked in upcoming commits)
   
   - Safely recognize or migrate the legacy (unquoted) cron-entry format when 
adding/removing entries.
   - Add an upgrade regression covering "old-version creation → new-version 
removal", while retaining the existing tests for spaces and single quotes in 
paths.
   - Using `util.sh` helpers in the monitor scripts as needed.
   
   ---
   
   


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