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

Why constant UNKNOWN_TOPIC_CACHE_EXPIRE_SECONDS (module brod_client) hard set 120 seconds? #570

Open
dbegunkov opened this issue Dec 18, 2023 · 2 comments

Comments

@dbegunkov
Copy link

dbegunkov commented Dec 18, 2023

I observe a strange behavior when there is no topic in Kafka. Topic status is cached. So when it’s created there is a delay up to 120 seconds. This is because of the constant -define(UNKNOWN_TOPIC_CACHE_EXPIRE_SECONDS, 120) in brod_client module.

Is there any reason why this delay is so high? And could we make it configurable?

@zmstone
Copy link
Contributor

zmstone commented Feb 15, 2024

Hi @dbegunkov
Topic re-creation was not taken into account when it was implemented.
The cache was to avoid refreshing metadata too often, also to survive temporary errors like leader unavailable errors etc.

We should probably inspect Reason at this line

[{_, {error, Reason}, Ts}] ->

and expire immediately if it's unknown_topic_or_partiton and expire immediately.

@dbegunkov
Copy link
Author

Yes - this is also a good option, it seems to me

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

No branches or pull requests

2 participants