-
Notifications
You must be signed in to change notification settings - Fork 14k
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-5293. Do not apply exponential backoff if users have overridden… #3174
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 for the PR. Left a couple of comments. Also: don't we have to change the Connect defaults?
* @param reconnectBackoffMax The name of the configuraiton key for maximum reconnect backoff. | ||
* @return The new values which have been set as described in postProcessParsedConfig. | ||
*/ | ||
protected Map<String, Object> postProcessReconnectBackoffConfigs(Map<String, Object> parsedValues, |
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.
Hmm, we shouldn't add this method here as AbstractConfig
is a generic class that shouldn't know about specific configs like reconnectBackoff
. We could add this method to CommonClientConfigs
perhaps?
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.
Well... it does allow you to parameterize the key names, so it is generic in that sense.
Unfortunately, we need access to AbstractConfig#originals
, which is currently private. And I think one or two other private things in AbstractConfig
. So we can't put this in a utility at the moment.... but at least it is protected
, so it is not exposed to end-users and we could change it later.
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.
originals()
is public:
public Map<String, Object> originals() {
It's not generic if reconnectBackoff
and reconnectBackoffMax
are mentioned. :) Also, AbstractConfig
is meant to be subclassed, so protected
methods are public API and cannot be changed.
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.
OK. I'll move it to CommonClientConfigs
.
@@ -439,7 +439,7 @@ | |||
RECONNECT_BACKOFF_MS_DOC) | |||
.define(RECONNECT_BACKOFF_MAX_MS_CONFIG, | |||
ConfigDef.Type.LONG, | |||
50L, | |||
1000L, |
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.
@guozhangwang @dguy Is this change OK?
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.
I'm not sure of the original motivation behind setting it to 50
. But if we are going to define it as 1000
i think it might be better to remove this and reconnect_backoff_min_ms_config
definitations from here as they are the same as what is set in the ProducerConfig
and ConsumerConfig
, so it seem pretty pointless overriding them
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.
When Dana implemented exponential backoff, she disabled it for Streams and Connect. I don't think there's a good reason not to enable it for those two and hence this PR. In the Streams case, I think those two configs are actually used for the StreamsKafkaClient
.
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
retest this please |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
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 for the PR, LGTM. I had just a couple of minor comments. We can merge after we decide if we should do something about them or not.
HashMap<String, Object> rval = new HashMap<>(); | ||
if (config.originals().containsKey(reconnectBackoffMaxKey)) | ||
return rval; | ||
if (!config.originals().containsKey(reconnectBackoffKey)) |
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: maybe we should include this in the previous check
* @param config The config object. | ||
* @param parsedValues The parsedValues as provided to postProcessParsedConfig. | ||
* @param reconnectBackoffKey The name of the configuraiton key for reconnect backoff. | ||
* @param reconnectBackoffMaxKey The name of the configuraiton key for maximum reconnect backoff. |
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.
Since RECONNECT_BACKOFF_MS_CONFIG
and RECONNECT_BACKOFF_MAX_MS_CONFIG
are defined in this class too, is it really useful to pass the key and value from every usage? It seems like every one of them passes the same configs.
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
… reconnect.backoff.ms
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 for the PR, LGTM. Merging to trunk and 0.11.0.
… reconnect.backoff.ms Author: Colin P. Mccabe <cmccabe@confluent.io> Reviewers: Ismael Juma <ismael@juma.me.uk> Closes #3174 from cmccabe/KAFKA-5293 (cherry picked from commit b3036c5) Signed-off-by: Ismael Juma <ismael@juma.me.uk>
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
… reconnect.backoff.ms