Skip to content

Fix misleading fields in log statements - #866

Open
ZayanKhan-12 wants to merge 1 commit into
linkedin:masterfrom
ZayanKhan-12:fix/misleading-log-fields
Open

Fix misleading fields in log statements#866
ZayanKhan-12 wants to merge 1 commit into
linkedin:masterfrom
ZayanKhan-12:fix/misleading-log-fields

Conversation

@ZayanKhan-12

Copy link
Copy Markdown

Problem

Two log statements report fields that don't carry the information they claim to:

  1. consumer/kafka_client.godecodeAndSendOffset: the decode-failure warning logs offsetValue.Offset and offsetValue.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.

  2. notifier/coordinator.gomanageEvalLoop: the "starting evaluations" and "stopping evaluations" info logs attach zap.Error(err) where err is the earlier lock.Lock() result — which is always nil on these paths (the error case continues 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/zookeeper tests are excluded under -race by build tag and their non-race run fails identically on pristine master in my environment — pre-existing, unrelated).

🤖 Generated with Claude Code

- 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>
@ZayanKhan-12
ZayanKhan-12 requested a review from bai as a code owner July 22, 2026 17:07
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.

1 participant