-
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
Panic: assignment to entry in nil map #422
Comments
Can you run it while capturing |
Hmm, based on the backtrace alone, if we close the client while the background metadata updater is running there might be a race that looks something like this... |
@wvanbergen Ill turn on logging, but it could take a couple of days before we hit it again :) |
@eapache - I can see in our logs that we closed the client a few seconds before the panic. |
Our broker list is static, so in the short-term I'm going to just disable to background updater by setting the RefreshFrequency to zero. https://github.com/Shopify/sarama/blob/9b048b0f558f2e7f420b11688d669aaa22d77d6a/config.go#L136 as a workaround. |
Looks like we need to properly stop the background metadata updater before we can continue the shutdown process. @epsniff FYI: we always turn on sarama logging even in production. In normal operation, you will only see a single log line every 10 minutes (the background updater), but when shit hits the fan the information is invaluable. |
I have a unit test that reproduces this stack trace. Fix incoming shortly. |
Thanks to both of you! Talk about opensource working! I'd like to see an enterprise product turn around a fix that fast. And I'll have sarama logging on in the future :). |
Otherwise, in the rare case where a background metadata refresh coincided exactly with a call to `Client.Close()` there was a race where we might have potentially tried to write to a nil map. Also add a test for this. Fixes #422.
Otherwise, in the rare case where a background metadata refresh coincided exactly with a call to `Client.Close()` there was a race where we might have potentially tried to write to a nil map. Also add a test for this. Fixes #422.
Hi all,
I'm still digging in (updates to come) but we are seeing this panic from the sarama client:
The text was updated successfully, but these errors were encountered: