Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

cmccabe
Copy link
Contributor

@cmccabe cmccabe commented May 31, 2017

… reconnect.backoff.ms

Copy link
Contributor

@ijuma ijuma left a 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,
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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,
Copy link
Contributor

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?

Copy link
Contributor

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

Copy link
Contributor

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.

@asfbot
Copy link

asfbot commented May 31, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/4606/
Test PASSed (JDK 7 and Scala 2.11).

@asfbot
Copy link

asfbot commented May 31, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/4591/
Test PASSed (JDK 8 and Scala 2.12).

@asfbot
Copy link

asfbot commented May 31, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/4637/
Test FAILed (JDK 8 and Scala 2.12).

@asfbot
Copy link

asfbot commented May 31, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/4652/
Test FAILed (JDK 7 and Scala 2.11).

@asfbot
Copy link

asfbot commented May 31, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/4680/
Test PASSed (JDK 7 and Scala 2.11).

@asfbot
Copy link

asfbot commented May 31, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/4665/
Test FAILed (JDK 8 and Scala 2.12).

@cmccabe
Copy link
Contributor Author

cmccabe commented Jun 1, 2017

retest this please

@asfbot
Copy link

asfbot commented Jun 1, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/4677/
Test PASSed (JDK 8 and Scala 2.12).

@asfbot
Copy link

asfbot commented Jun 1, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/4693/
Test PASSed (JDK 7 and Scala 2.11).

Copy link
Contributor

@ijuma ijuma left a 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))
Copy link
Contributor

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.
Copy link
Contributor

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.

@asfbot
Copy link

asfbot commented Jun 1, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/4737/
Test FAILed (JDK 7 and Scala 2.11).

@asfbot
Copy link

asfbot commented Jun 1, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/4721/
Test FAILed (JDK 8 and Scala 2.12).

@asfbot
Copy link

asfbot commented Jun 1, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/4723/
Test PASSed (JDK 8 and Scala 2.12).

Copy link
Contributor

@ijuma ijuma left a 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.

asfgit pushed a commit that referenced this pull request Jun 1, 2017
… 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>
@asfgit asfgit closed this in b3036c5 Jun 1, 2017
@asfbot
Copy link

asfbot commented Jun 1, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/4739/
Test PASSed (JDK 7 and Scala 2.11).

@asfbot
Copy link

asfbot commented Jun 1, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/4729/
Test PASSed (JDK 8 and Scala 2.12).

@asfbot
Copy link

asfbot commented Jun 1, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/4745/
Test PASSed (JDK 7 and Scala 2.11).

@cmccabe cmccabe deleted the KAFKA-5293 branch May 20, 2019 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants