You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by "AnonHxy (via GitHub)" <gi...@apache.org> on 2023/10/26 13:58:38 UTC
[PR] Fix shell start localbookie if not specify NUMBER [bookkeeper]
AnonHxy opened a new pull request, #4119:
URL: https://github.com/apache/bookkeeper/pull/4119
Descriptions of the changes in this PR:
If we run the cmd `bin/bookkeeper localbookie` without specify the $NUMBER, it will exit without any message. It's better print the help message
### Motivation
(Explain: why you're making that change, what is the problem you're trying to solve)
### Changes
--
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: commits-unsubscribe@bookkeeper.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix shell start localbookie exit without msg if not specify NUMBER [bookkeeper]
Posted by "zymap (via GitHub)" <gi...@apache.org>.
zymap commented on code in PR #4119:
URL: https://github.com/apache/bookkeeper/pull/4119#discussion_r1390547791
##########
bin/bookkeeper:
##########
@@ -162,6 +162,10 @@ elif [ ${COMMAND} == "autorecovery" ]; then
exec "${JAVA}" ${OPTS} ${JMX_ARGS} org.apache.bookkeeper.replication.AutoRecoveryMain --conf ${BOOKIE_CONF} $@
elif [ ${COMMAND} == "localbookie" ]; then
NUMBER=$1
+ if [[ ! "$NUMBER" =~ ^[0-9]+$ ]]; then
+ bookkeeper_help;
+ exit 1;
+ fi
Review Comment:
The local bookie already handles the argument checks in the code. https://github.com/apache/bookkeeper/blob/acde49c349b6856f25ab0b00ef50412b844182a0/bookkeeper-server/src/main/java/org/apache/bookkeeper/util/LocalBookKeeper.java#L358
So we can change this to
```
args="$1 ${BOOKIE_CONF} $@"
exec "${JAVA}" ${OPTS} ${JMX_ARGS} -Dzookeeper.4lw.commands.whitelist='*' org.apache.bookkeeper.util.LocalBookKeeper ${args}
```
--
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: commits-unsubscribe@bookkeeper.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix shell start localbookie exit without msg if not specify NUMBER [bookkeeper]
Posted by "AnonHxy (via GitHub)" <gi...@apache.org>.
AnonHxy commented on code in PR #4119:
URL: https://github.com/apache/bookkeeper/pull/4119#discussion_r1391260053
##########
bin/bookkeeper:
##########
@@ -162,6 +162,10 @@ elif [ ${COMMAND} == "autorecovery" ]; then
exec "${JAVA}" ${OPTS} ${JMX_ARGS} org.apache.bookkeeper.replication.AutoRecoveryMain --conf ${BOOKIE_CONF} $@
elif [ ${COMMAND} == "localbookie" ]; then
NUMBER=$1
+ if [[ ! "$NUMBER" =~ ^[0-9]+$ ]]; then
+ bookkeeper_help;
+ exit 1;
+ fi
Review Comment:
Thanks for your review @zymap
Do you mean:
```
args="$1"
shift
args="$args ${BOOKIE_CONF} $@"
exec "${JAVA}" ${OPTS} ${JMX_ARGS} -Dzookeeper.4lw.commands.whitelist='*' org.apache.bookkeeper.util.LocalBookKeeper $args
```
I don't think this is a solution. The same problem still exists if we just run the cmd following:
```
bin/bookkeeper localbookie
```
--
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: commits-unsubscribe@bookkeeper.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix shell start localbookie exit without msg if not specify NUMBER [bookkeeper]
Posted by "AnonHxy (via GitHub)" <gi...@apache.org>.
AnonHxy commented on PR #4119:
URL: https://github.com/apache/bookkeeper/pull/4119#issuecomment-1806674550
@zymap @hangc0276 @eolivelli PTAL
--
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: commits-unsubscribe@bookkeeper.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org