Skip to content

fix: avoid logging io.EOF as error level in PostMsgSend and PostMsgReceive - #822

Open
dbeneker wants to merge 1 commit into
grpc-ecosystem:mainfrom
dbeneker:main
Open

fix: avoid logging io.EOF as error level in PostMsgSend and PostMsgReceive#822
dbeneker wants to merge 1 commit into
grpc-ecosystem:mainfrom
dbeneker:main

Conversation

@dbeneker

Copy link
Copy Markdown
Contributor

Fixes #821

Changes

  • Normalize io.EOF to nil in PostMsgSend and PostMsgReceive of the
    logging reporter, same as PostCall already does. io.EOF from
    SendMsg/RecvMsg signals normal stream termination, so the "started call"
    line no longer gets logged at error level with grpc.error: EOF attached.

Verification

  • Added TestPingStream_EOFIsNotLoggedAsError: a bidi stream where the client
    calls CloseSend() without sending a message, so the first RecvMsg on both
    sides returns io.EOF. The test fails without the fix (error level +
    grpc.error: EOF on both client and server) and passes with it.

avoid logging io.EOF as error in PostMsgSend and PostMsgReceive
io.EOF from SendMsg/RecvMsg signals normal stream termination, not a
failure. PostCall already normalizes it to nil, but PostMsgSend and
PostMsgReceive passed it to codeFunc/levelFunc, causing the "started
call" line to be logged at error level with grpc.error attached.
Normalize io.EOF to nil after the payload gates are computed, so no
empty payload is logged for the EOF event.
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.

io.EOF logged as error in PostMsgSend/PostMsgReceive

1 participant