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-3417: Wrap reporter calls in try/catch blocks #3635

Merged
merged 1 commit into from Apr 30, 2018

Conversation

mimaison
Copy link
Member

@mimaison mimaison commented Aug 7, 2017

No description provided.

@asfgit
Copy link

asfgit commented Aug 7, 2017

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

@asfgit
Copy link

asfgit commented Aug 7, 2017

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

Copy link
Contributor

@rajinisivaram rajinisivaram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mimaison @edoardocomar I think we need to handle client-ids consistently for metrics and quotas and I have raised KAFKA-5735 to do this in the broker and Java clients. It requires a KIP. Would you be interested in doing the KIP and implementation?

Apart from quoting metrics (which is not backward compatible), the other changes in this PR are worth doing anyway.

@@ -133,7 +133,7 @@ static String getMBeanName(String prefix, MetricName metricName) {
mBeanName.append(",");
mBeanName.append(entry.getKey());
mBeanName.append("=");
mBeanName.append(entry.getValue());
mBeanName.append(ObjectName.quote(entry.getValue()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an externally visible change since client-id appears quoted in metrics and can break users who rely on the existing un-quoted value.

@mimaison
Copy link
Member Author

Thanks for the feedback. I agree, quoting everything is a bit too invasive ! That was made on the spot WRT the quota issue.
Regarding the try/catch, I too think they are worth doing. I'll update the PR to only do that.

The changes you suggested in the JIRA sound good. I'm happy to work on the KIP

@rajinisivaram
Copy link
Contributor

Thanks @mimaison, I have assigned KAFKA-5735 to you.

@asfgit
Copy link

asfgit commented Aug 16, 2017

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

@asfgit
Copy link

asfgit commented Aug 16, 2017

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

@mimaison mimaison changed the title KAFKA-3417: Quote client-id and wrap reporter calls in try/catch blocks KAFKA-3417: Wrap reporter calls in try/catch blocks Aug 16, 2017
@mimaison
Copy link
Member Author

@rajinisivaram Do you have any objections against these changes ? Even though we've fixed the client-ids issue, any exceptions thrown by reporters could also cause quotas issues.

@rajinisivaram
Copy link
Contributor

@mimaison Perhaps we want to propagate the exception for clients?

@mimaison
Copy link
Member Author

@rajinisivaram Sorry I got dragged into other things and I had forgotten about this PR !

I'm not sure propagating the exception is necessarily what we want. We wouldn't want to prevent a client running because one (badly behaving) reporter is throwing exceptions.

Prevent exception thrown by metric reporters to impact request processing and other reporters.

Co-authored-by: Mickael Maison <mickael.maison@gmail.com>
Co-authored-by: Edoardo Comar <ecomar@uk.ibm.com>
@mimaison
Copy link
Member Author

Currently if a reporter throws an exception while a request is being processed, the broker won't even send a response back to the client. Also if there are other reporters they won't be called at all.

This change prevent exceptions thrown by metric reporters to impact request processing and other reporters.

Copy link
Contributor

@rajinisivaram rajinisivaram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mimaison Thanks for the PR, LGTM.

@rajinisivaram rajinisivaram merged commit 902009e into apache:trunk Apr 30, 2018
jeqo pushed a commit to jeqo/kafka that referenced this pull request May 2, 2018
Prevent exception thrown by metric reporters to impact request processing and other reporters.

Co-authored-by: Mickael Maison <mickael.maison@gmail.com>
Co-authored-by: Edoardo Comar <ecomar@uk.ibm.com>

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>
ying-zheng pushed a commit to ying-zheng/kafka that referenced this pull request Jul 6, 2018
Prevent exception thrown by metric reporters to impact request processing and other reporters.

Co-authored-by: Mickael Maison <mickael.maison@gmail.com>
Co-authored-by: Edoardo Comar <ecomar@uk.ibm.com>

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants