Copilot commented on code in PR #3000:
URL: https://github.com/apache/hugegraph/pull/3000#discussion_r3105882029


##########
hugegraph-server/hugegraph-dist/docker/docker-entrypoint.sh:
##########
@@ -81,12 +81,14 @@ else
     log "HugeGraph initialization already done. Skipping re-init..."
 fi
 
-STORE_REST="${STORE_REST:-store:8520}"
-export STORE_REST
-
 ./bin/start-hugegraph.sh -j "${JAVA_OPTS:-}" -t 120
 
-# Post-startup cluster stabilization check
-./bin/wait-partition.sh || log "WARN: partitions not assigned yet"
+# Post-startup cluster stabilization check (hstore only — rocksdb has no 
partitions)
+ACTUAL_BACKEND=$(grep -E '^\s*backend\s*=' "${GRAPH_CONF}" | sed 's/.*=\s*//' 
| tr -d ' ')

Review Comment:
   The backend parsing uses `\s` in both the `grep -E` and `sed` expressions. 
In ERE/BRE (and GNU sed without PCRE), `\s` is not whitespace, so this won’t 
match indented `backend = ...` lines and can also behave unexpectedly. Since 
this script runs with `set -euo pipefail`, a non-match will cause the 
entrypoint to exit during startup. Consider switching to POSIX character 
classes (e.g., `[[:space:]]*`) and guarding the read with a fallback (e.g., 
default empty/rocksdb) so startup can’t fail if the key is missing or formatted 
differently; also ensure you only take a single match (first/last) to avoid 
embedding newlines in `ACTUAL_BACKEND`.
   ```suggestion
   ACTUAL_BACKEND=$(
       grep -E '^[[:space:]]*backend[[:space:]]*=' "${GRAPH_CONF}" \
           | head -n 1 \
           | sed 's/^[[:space:]]*backend[[:space:]]*=[[:space:]]*//; 
s/[[:space:]]*$//' \
           || true
   )
   ```



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