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

Prevent crashes by ensuring topics are created #392

Closed
wants to merge 1 commit into from

Conversation

mhratson
Copy link
Collaborator

@mhratson mhratson commented Jan 17, 2023

addresses #390

Context

  1. whenever a kafka-monitor starts monitoring a new cluster
  2. it has to create topics (if enabled)
  3. monitoring process then describes the topics and does its job

Problem

  • due to possible delays between 1. and 2.
  • step 2 may crash, as due to propagation delay, metadata may not be yet available
  • this prevents kafka-monitor from starting as this may happen for multiple topics that may have to be created

Solution

  1. after creation query topic metadata
  2. use retries and backoff to allow enough time for the metadata propagation

Potential issues

  1. slower start

@@ -171,14 +171,15 @@ public void awaitShutdown(long timeout, TimeUnit unit) {
}

private class TopicManagementRunnable implements Runnable {
private static final int MAX_TOPIC_FETCH_ATTEMPTS = 5;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Make configurable?

@mhratson
Copy link
Collaborator Author

will revisit the implementation later…

@mhratson mhratson closed this May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants