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

High volume metadata requests #49

Open
mjquinlan opened this issue Aug 29, 2016 · 0 comments
Open

High volume metadata requests #49

mjquinlan opened this issue Aug 29, 2016 · 0 comments
Assignees

Comments

@mjquinlan
Copy link

Hi Hernán,

In one of my applications, I've implemented a procedure of calling kafkerl:request_metadata() whenever I receive a Kafka based error to a data request. I've noticed that when the volume of requests are high during a cluster rebalance, the metadata request isn't being made. Instead the cooldown logic is blocked in this case. I suggest the following:

https://github.com/HernanRivasAcosta/kafkerl/blob/master/src/kafkerl_connector.erl#L341

case Cooldown - (Now - LastRequest) of
  Negative when Negative =< 0 ->
    _ = make_metadata_request(State),
    State#state{broker_mapping = void, known_topics = NewKnownTopics,
              last_metadata_request = Now};
  Time ->
    _ = timer:apply_after(Time, ?MODULE, request_metadata, [self(), true])
    State#state{broker_mapping = void, known_topics = NewKnownTopics,
              last_metadata_request = LastRequest}
end.      
@HernanRivasAcosta HernanRivasAcosta self-assigned this Sep 1, 2016
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