-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
KAFKA-6979: Add default.api.timeout.ms to KafkaConsumer (KIP-266) #5122
Conversation
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.
Thanks, just one minor comment.
@@ -91,6 +91,9 @@ | |||
+ "elapses the client will resend the request if necessary or fail the request if " | |||
+ "retries are exhausted."; | |||
|
|||
public static final String MAX_BLOCK_MS_CONFIG = "max.block.ms"; | |||
public static final String MAX_BLOCK_MS_DOC = "The configuration controls the maximum time that the consumer will block for"; |
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.
This is CommonClientConfigs
, so we should avoid consumer-specific documentation. The producer also has a max.block.ms config, so if we could come up with a generic way to document the behavior of both, it would make sense to write it here. Otherwise, I'd suggest documenting separately.
retest this please |
1 similar comment
retest this please |
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.
Thanks @dhruvilshah3 for the PR.
Current javadoc of the updated methods in this PR need to be modified for timeout behavior like it is done in other methods in this class.
- Change the description to cover timeout expiration along with success/error scenarios.
- Add
throws
javadoc forTimeoutException
Also, can you update the upgrade notes? We mention KIP-266, but not the new configuration. |
dbe5803
to
5abbfb2
Compare
@@ -218,6 +218,10 @@ | |||
public static final String REQUEST_TIMEOUT_MS_CONFIG = CommonClientConfigs.REQUEST_TIMEOUT_MS_CONFIG; | |||
private static final String REQUEST_TIMEOUT_MS_DOC = CommonClientConfigs.REQUEST_TIMEOUT_MS_DOC; | |||
|
|||
/** <code>max.block.ms</code> */ | |||
public static final String MAX_BLOCK_MS_CONFIG = "max.block.ms"; | |||
public static final String MAX_BLOCK_MS_DOC = "The configuration controls the maximum time that the consumer will block for"; |
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.
The config name was chosen for consistency with the producer, but it is not an ideal name when considering the consumer in isolation. The consumer can block longer than this if a longer timeout is passed to any blocking API that accepts a timeout. Can we explain that this config is only used as the default timeout for operations which do not have an explicit timeout option? Similarly for the changes in the upgrade docs.
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.
LGTM, thanks @dhruvilshah3 for addressing review comments.
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.
LGTM. The only question I had is whether default.timeout.ms
would be a better name for this config. I'll send a message to the vote thread and see what the community thinks before merging.
Made a pass over the PR, the change LGTM as well besides the config name. I'm still currently in favor of adding a new config than leveraging on |
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.
Thanks, had a minor nitpick, but looks good otherwise. Also, can you update the PR title?
@@ -218,6 +218,10 @@ | |||
public static final String REQUEST_TIMEOUT_MS_CONFIG = CommonClientConfigs.REQUEST_TIMEOUT_MS_CONFIG; | |||
private static final String REQUEST_TIMEOUT_MS_DOC = CommonClientConfigs.REQUEST_TIMEOUT_MS_DOC; | |||
|
|||
/** <code>max.block.ms</code> */ | |||
public static final String DEFAULT_API_TIMEOUT_MS_CONFIG = "default.api.timeout.ms"; | |||
public static final String DEFAULT_API_TIMEOUT_MS_DOC = "Specifies the timeout (in milliseconds) for consumer APIs that could block. This configuration is used as the default timeout for all consumer operations that do not explicitly accept a <code>timeout</code> option."; |
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.
nit: instead of timeout "option," how about "parameter" or "argument"?
max.block.ms
to KafkaConsumer02538ca
to
9b46267
Compare
…5122) Adds a configuration that specifies the default timeout for KafkaConsumer APIs that could block. This was introduced in KIP-266. Reviewers: Satish Duggana <satish.duggana@gmail.com>, Jason Gustafson <jason@confluent.io>
…pache#5122) Adds a configuration that specifies the default timeout for KafkaConsumer APIs that could block. This was introduced in KIP-266. Reviewers: Satish Duggana <satish.duggana@gmail.com>, Jason Gustafson <jason@confluent.io>
Adds a configuration that specifies the default timeout for KafkaConsumer APIs that could block.