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-18489 - Fix Connector tasks metrics task-startup-attempts, task… #18762

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

ashwinpankaj
Copy link
Contributor

@ashwinpankaj ashwinpankaj commented Jan 31, 2025

…-startup-success

A minor bug was introduced as part of EOS in Apache Kafka 3 years ago The line

final TaskStatus.Listener taskStatusListener = workerMetricsGroup.wrapStatusListener(statusListener);

wraps herder's listener in workerMetricsGroup's listener. WorkerMetricsGroup is the entity which records task success and failure in the metric .
In the PR, the wrapped listener was missed and instead the herder listener is passed to the task builder (as part of constructor).

workerMetricsGroup's UT already validates that the metrics get updated when tasks fail or succeed.
I did not see a way to test connector's metrics using JMX

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@github-actions github-actions bot added triage PRs from the community connect small Small PRs labels Jan 31, 2025
@ashwinpankaj ashwinpankaj marked this pull request as draft January 31, 2025 05:50
@ashwinpankaj ashwinpankaj marked this pull request as ready for review January 31, 2025 05:55
@mimaison
Copy link
Member

Thanks for the PR.

I've not looked into this issue but if we're fixing some logic then I was expecting some updates in the tests too. Why are the existing tests passing if you say that some metrics are not updated correctly? Are they not tested?

@ashwinpankaj
Copy link
Contributor Author

Thanks @mimaison - yes. What we have are unit tests for workermetricsgroup - which ensure that if wrappedListener is used metrics will get updated. But there are no tests to ensure that workermetricsgroup's task status listener is used while building tasks

@mimaison
Copy link
Member

mimaison commented Feb 3, 2025

But there are no tests to ensure that workermetricsgroup's task status listener is used while building tasks

Ok, then we need to create these tests in this PR. We can't just change code without adding matching tests.

Copy link

github-actions bot commented Feb 8, 2025

A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the triage label
should be removed to prevent this automation from happening again.

@ashwinpankaj
Copy link
Contributor Author

@mimaison thanks ! Can you please point to a test where we check the value of metrics using JMX so that I can create a test based on it ?

@mimaison
Copy link
Member

Have a look in WorkerTest, you can find methods like assertStatusMetrics() that check metrics without using JMX.

Copy link

A label of 'needs-attention' was automatically added to this PR in order to raise the
attention of the committers. Once this issue has been triaged, the triage label
should be removed to prevent this automation from happening again.

@mimaison mimaison removed triage PRs from the community needs-attention labels Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants