Fix misleading fields in log statements - #866
Open
ZayanKhan-12 wants to merge 1 commit into
Open
Conversation
- decodeAndSendOffset logged offsetValue.Offset and offsetValue.Timestamp in its decode-failure warning, but the decoder returns early on error, so those fields are zero or only partially filled in. Logging them makes a failed decode look like a real offset. Log only the reason, consistent with every other decode-failure warning in the file. - manageEvalLoop logged "starting evaluations" and "stopping evaluations" with zap.Error(err), where err is the result of the earlier lock.Lock() call and is always nil on these paths (the error case continues the loop). The field never carries information; drop it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Two log statements report fields that don't carry the information they claim to:
consumer/kafka_client.go—decodeAndSendOffset: the decode-failure warning logsoffsetValue.OffsetandoffsetValue.Timestamp, but the decoder returned early on error, so those fields are zero or only partially filled in. A failed decode gets logged with what looks like a real offset/timestamp (e.g.offset=0 timestamp=0), which is misleading when debugging offset consumption. Every other decode-failure warning in the file logs only the reason.notifier/coordinator.go—manageEvalLoop: the "starting evaluations" and "stopping evaluations" info logs attachzap.Error(err)whereerris the earlierlock.Lock()result — which is alwaysnilon these paths (the error casecontinues the loop). The field never carries information.Fix
Drop the fields. No behavior change beyond log output.
Testing
go test -race ./...passes (note:core/internal/zookeepertests are excluded under-raceby build tag and their non-race run fails identically on pristine master in my environment — pre-existing, unrelated).🤖 Generated with Claude Code