-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pulsar-perf] Make it possible to disable poolMessages #12090
[pulsar-perf] Make it possible to disable poolMessages #12090
Conversation
- JCommander requires passing arity = 1 to boolean parameters that have a default value of true.
LGTM. Should we also cover other similar parameters? |
@Parameter(names = {"--batch-index-ack" }, description = "Enable or disable the batch index acknowledgment") | ||
public boolean batchIndexAck = false; | ||
|
||
@Parameter(names = { "-pm", "--pool-messages" }, description = "Use the pooled message") | ||
@Parameter(names = { "-pm", "--pool-messages" }, description = "Use the pooled message", arity = 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!Should other parameter that type is boolean be handled like this? such as --replicated
, --batch-index-ack
, --auto_ack_chunk_q_full
etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be a breaking change. This is only necessary for boolean options that default to true.
It would be a breaking change. This is only necessary for boolean options that default to true. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
- JCommander requires passing arity = 1 to boolean parameters that have a default value of true. (cherry picked from commit 898582b)
- JCommander requires passing arity = 1 to boolean parameters that have a default value of true.
Motivation
In Pulsar 2.8.0 with pulsar-perf, I hit the bug #11824 where the
pulsar-perf consume
stops consuming some partitions.As a workaround, I tried to pass
-pm false
or--pool-messages false
on the command line, but this resulted in error message:The size of topics list should be equal to --num-topics
The problem is that JCommander doesn't expect arguments to boolean parameters by default.
This is explained in the JCommander manual and issue comment cbeust/jcommander#129 (comment) .
Modifications
arity = 1
to the JCommander Parameter annotation.arity = 1
to boolean parameters that have a default value of true.