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

KafkaMetrics' refresh scheduler can stop in some corner cases #2879

Closed
jonatan-ivanov opened this issue Nov 30, 2021 · 0 comments
Closed

KafkaMetrics' refresh scheduler can stop in some corner cases #2879

jonatan-ivanov opened this issue Nov 30, 2021 · 0 comments
Assignees
Labels
bug A general bug module: micrometer-core An issue that is related to our core module
Milestone

Comments

@jonatan-ivanov
Copy link
Member

Describe the bug
KafkaMetrics uses a ScheduledExecutorService to schedule a task that refreshes the Meters based on the available Kafka Metrics. If this task fails, the scheduler will never reschedule it.
See:

scheduler.scheduleAtFixedRate(() -> checkAndBindMetrics(registry), getRefreshIntervalInMillis(), getRefreshIntervalInMillis(), TimeUnit.MILLISECONDS);

If checkAndBindMetrics throws an exception ScheduledExecutorService stops scheduling.

Environment

  • Micrometer version: 1.7.6, 1.8.0
  • Micrometer registry: all/unrelated
  • OS: all/unrelated
  • Java version: all/unrelated

To Reproduce
One way reproducing it is triggering Kafka to rebalance, see #2843 (comment)

Expected behavior
If any error arises during refreshing the Meters, scheduling should not stop.

Additional context
We should not just fix the problem that causes the exception but handle and log all of the exceptions that can be thrown from that method.

@jonatan-ivanov jonatan-ivanov added bug A general bug module: micrometer-core An issue that is related to our core module labels Nov 30, 2021
@jonatan-ivanov jonatan-ivanov added this to the 1.7.7 milestone Nov 30, 2021
@jonatan-ivanov jonatan-ivanov self-assigned this Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A general bug module: micrometer-core An issue that is related to our core module
Projects
None yet
Development

No branches or pull requests

1 participant