-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fixed panic on calling updateMetadata on closed client #1531
Conversation
I added a couple more in 93f4001. |
There was an error with the build (some timeout on starting Kafka). I restarted the build and it is green now :) summon @bai |
👋Thanks for contributing! |
I wonder if there is a way to add some test for this @roblaszczak ? |
Probably it may be a good idea to add some tests around concurrent |
BTW @bai, any news on releasing it? It would be nice to be able to finally update Sarama version :) |
Currently seeing this issue intermittently with 1.24.1. Can you guys tag a new release? |
@@ -529,6 +532,11 @@ func (client *client) RefreshCoordinator(consumerGroup string) error { | |||
// in the brokers map. It returns the broker that is registered, which may be the provided broker, | |||
// or a previously registered Broker instance. You must hold the write lock before calling this function. | |||
func (client *client) registerBroker(broker *Broker) { | |||
if client.brokers == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a race condition, no?
It checks for client.brokers != nil
and then uses client.brokers
it could have been set to nil between the if client.brokers == nil
and if client.brokers[broker.ID()] == nil
Hello, after updateing sarama to
v1.24.1
in https://github.com/ThreeDotsLabs/watermill-kafka our tests are failing because ofassignment to entry in nil map
:It can be reproduced by running in https://github.com/ThreeDotsLabs/watermill-kafka on commit
bdc2102750adb8d43389a8bd9d1621e645c787dc
fromfix-tests
branch repository: