Extra whitespaces in debug opts in alluxio-env.sh
causes processes to fail to start
#18249
Labels
type-bug
This issue is about a bug
Alluxio Version:
Current main
Describe the bug
Alluxio processes fail to start if
ALLUXIO_*_ATTACH_OPTS
is set and contains a leading or trailing whitespace.logs/worker.out
saysError: Could not find or load main class
. No class name is included in this error message.To Reproduce
ALLUXIO_WORKER_ATTACH_OPTS
to-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=60003
, with a leading whitespace, inconf/alluxio-env.sh
.bin/alluxio process start worker
Expected behavior
The worker process should start normally, with the debugging port open.
Urgency
Normal
Are you planning to fix it
No
Additional context
alluxio/cli/src/alluxio.org/cli/processes/worker.go
Lines 73 to 77 in 8329244
The launcher prepends the attach opts to the command, by first splitting the opts with a whitespace as the delimiter. In the case where the opts string contains a leading whitespace, there is a empty string after the split. This empty string is then passed to the
java
command as a positional argument, which interprets it as the name of a main class.Since
alluxio-env.sh
is a shell script, a user can reasonably expect to set the options with a leading whitespace as they are usually concatenated to form a longer command line. Not respecting this convention may be surprising.The text was updated successfully, but these errors were encountered: