-
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
Sarama panic when enable Net.Proxy #2547
Comments
Thanks for the detailed bug report. Playing around with the example code - it looks like the logger would emit something like:
(Assuming it didn't race into a panic due to concurrent map access). This doesn't look like particularly valuable debug information to log. I wonder if the problematic logging should be changed to:
|
Usually, the proxy of producer should not be changed frequently. I think user should know whether use proxy and which proxy to be used. If the proxy information must be log in the sarama, I would recommend using the first one. |
If Go's logging implementation is plugged into Sarama then it will introspect the contents of the Dialer, potentially giving rise to concurrent access to a map used to implement the dialer. Fixes IBM#2547 Signed-off-by: Adrian Preston <[email protected]>
If Go's logging implementation is plugged into Sarama then it will introspect the contents of the Dialer, potentially giving rise to concurrent access to a map used to implement the dialer. Fixes #2547 Signed-off-by: Adrian Preston <[email protected]>
Versions
Please specify real version numbers or git SHAs, not just "Latest" since that changes fairly regularly.
Configuration
What configuration values are you using for Sarama and Kafka?
Logs
When filing an issue please provide logs from Sarama and Kafka if at all
possible. You can set
sarama.Logger
to alog.Logger
to capture Sarama debugoutput.
logs: CLICK ME
Problem Description
When the broker is Open, the conf.getDialer method is invoked. In the method, Logger.Printf is invoked to print the c.Net.Proxy.Dialer. The net.Dialer.Resolver is read during printing. However, the Resolver contains the singleflight.Group, which contains a field of the
map
type. This field is read during printing and written during broker connection establishment. Concurrent read and write withmap
causes panic:fatal error: concurrent map read and map write
.The text was updated successfully, but these errors were encountered: