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

Fix client.tryRefreshMetadata Println #1535

Merged
merged 1 commit into from
Nov 7, 2019

Conversation

slaunay
Copy link
Contributor

@slaunay slaunay commented Nov 7, 2019

Bugfix

Println is used instead of Printf for logging in client.tryRefreshMetadata which result in a bad %s substitution and a two lines log statement (see below).
This was introduced in commit fe1b184.

Versions

Sarama Kafka Go
1358e9c (v1.24.0) N/A 1.13

Logs

$ DEBUG=true go test -v -run=TestClientMetadataTimeout/timeout=250ms | grep -C 2 "not fetching
metadata"
[sarama] 2019/11/07 09:17:58 Closed connection to broker 127.0.0.1:50294
[sarama] 2019/11/07 09:17:58 ClientID is the default of 'sarama', you should consider setting it to something application-specific.
[sarama] 2019/11/07 09:17:58 client/metadata not fetching metadata from broker %s as we would go past the metadata timeout
 127.0.0.1:50295
[sarama] 2019/11/07 09:17:58 client/metadata skipping last retries as we would go past the metadata timeout

Changes

  • use Printf instead of Println

Testing done

Ran the same test after applying the fix:

$ DEBUG=true go test -v -run=TestClientMetadataTimeout/timeout=250ms | grep -C 2 "not fetching metadata"
[sarama] 2019/11/07 09:18:22 Closed connection to broker 127.0.0.1:50323
[sarama] 2019/11/07 09:18:22 ClientID is the default of 'sarama', you should consider setting it to something application-specific.
[sarama] 2019/11/07 09:18:22 client/metadata not fetching metadata from broker 127.0.0.1:50324 as we would go past the metadata timeout
[sarama] 2019/11/07 09:18:22 client/metadata skipping last retries as we would go past the metadata timeout
[sarama] 2019/11/07 09:18:22 Closing Client

@bai
Copy link
Contributor

bai commented Nov 7, 2019

Many thanks!

@bai bai merged commit 9ad3f01 into IBM:master Nov 7, 2019
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

Successfully merging this pull request may close these issues.

2 participants