-
Notifications
You must be signed in to change notification settings - Fork 15.4k
MINOR: Log4j Improvements on Fetcher #8629
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -260,7 +260,7 @@ public synchronized int sendFetches() { | |
| } | ||
| RequestFuture<ClientResponse> future = client.send(fetchTarget, request); | ||
| // We add the node to the set of nodes with pending fetch requests before adding the | ||
| // listener because the future may have been fulfilled on another thread (e.g. during a | ||
| // listenerbecause the future may have been fulfilled on another thread (e.g. during a | ||
| // disconnection being handled by the heartbeat thread) which will mean the listener | ||
| // will be invoked synchronously. | ||
| this.nodesWithPendingFetchRequests.add(entry.getKey().id()); | ||
|
|
@@ -676,13 +676,15 @@ private List<ConsumerRecord<K, V>> fetchRecords(CompletedFetch completedFetch, i | |
| if (completedFetch.nextFetchOffset == position.offset) { | ||
| List<ConsumerRecord<K, V>> partRecords = completedFetch.fetchRecords(maxRecords); | ||
|
|
||
| log.trace("Returning fetched records {} at offset {} for assigned partition {}", | ||
| partRecords, position, completedFetch.partition); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel logging all of the records even at TRACE level will be too much. For example, our system tests often have TRACE enabled. Huge single-line log messages are difficult to consume both visually and in systems like elastic.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense, it is primarily for my local debugging of an integration test which only sends a couple records. I will only print the num.records instead. |
||
|
|
||
| if (completedFetch.nextFetchOffset > position.offset) { | ||
| SubscriptionState.FetchPosition nextPosition = new SubscriptionState.FetchPosition( | ||
| completedFetch.nextFetchOffset, | ||
| completedFetch.lastEpoch, | ||
| position.currentLeader); | ||
| log.trace("Returning fetched records at offset {} for assigned partition {} and update " + | ||
| "position to {}", position, completedFetch.partition, nextPosition); | ||
| log.trace("Update fetching position to {} for partition {}", nextPosition, completedFetch.partition); | ||
| subscriptions.position(completedFetch.partition, nextPosition); | ||
| } | ||
|
|
||
|
|
||
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.
I assume this was unintentional.