silviucpp / erlkaf

Erlang kafka driver based on librdkafka
MIT License
84 stars 41 forks source link

fix: avoid assigning partitions if consumer is not running #60

Closed macasado86 closed 1 year ago

macasado86 commented 1 year ago

Hi!

We are having some problems when trying to stop multiple clients of the same consumer group concurrently. We have seen that in some occasions, we are receiving partition assignment requests (I guess due to rebalancing when stopping another client) on clients that already have the running flag set to false. This is preventing the client from being completely stopped (and I think generating a deadlock by not releasing all the rd_kafka objects).

I have included a check in the assignment method to verify that the client is not running (same mechanism as in the revoke partitions function).

silviucpp commented 1 year ago

Thanks for fixing. you are right regarding the fix !