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

sarama client panic: assignment to entry in nil map #1920

Closed
handsomewwu opened this issue Apr 26, 2021 · 3 comments
Closed

sarama client panic: assignment to entry in nil map #1920

handsomewwu opened this issue Apr 26, 2021 · 3 comments

Comments

@handsomewwu
Copy link

sarama version: v1.26.1

sarama will panic at client.go:533 while fetching metadata when the client is closed

image

client.brokers will be nil when the client is closed, but sarama does not check if client.brokers is nil before client.go:533
image

@handsomewwu
Copy link
Author

#422
this problem still happen
@eapache

@handsomewwu
Copy link
Author

handsomewwu commented Apr 26, 2021

panic: assignment to entry in nil map
goroutine 1393273 [running]:
github.com/Shopify/sarama.(*client).registerBroker(0xc00001e750, 0xc001c69500)
github.com/Shopify/sarama/client.go:533 +0x2cb
github.com/Shopify/sarama.(*client).updateMetadata(0xc00001e750, 0xc00064b8b0, 0xc00064b800, 0x0, 0x0, 0x0)
github.com/Shopify/sarama/client.go:844 +0xd5
github.com/Shopify/sarama.(*client).tryRefreshMetadata(0xc00001e750, 0xc001b61b10, 0x1, 0x1, 0x3, 0x0, 0x0, 0x0, 0x10, 0x7f6e50502e98)
github.com/Shopify/sarama/client.go:789 +0x82d
github.com/Shopify/sarama.(*client).RefreshMetadata(0xc00001e750, 0xc001b61b10, 0x1, 0x1, 0x1d693212d88835, 0xc00064b818)
/github.com/Shopify/sarama/client.go:442 +0xb0
github.com/Shopify/sarama.(*consumerGroup).topicToPartitionNumbers(0xc00001e7e0, 0xc001b61b10, 0x1, 0x1, 0x0, 0x7000102, 0x0)
/github.com/Shopify/sarama/consumer_group.go:472 +0x72
github.com/Shopify/sarama.(*consumerGroup).loopCheckPartitionNumbers(0xc00001e7e0, 0xc001b61b10, 0x1, 0x1, 0xc000337600)
/github.com/Shopify/sarama/consumer_group.go:450 +0xe0
created by github.com/Shopify/sarama.(*consumerGroup).Consume
/github.com/Shopify/sarama/consumer_group.go:178 +0x232

@handsomewwu
Copy link
Author

sorry this problem is fixed

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

1 participant