Skip to content

Conversation

Pranjali-2501
Copy link
Contributor

@Pranjali-2501 Pranjali-2501 commented Aug 19, 2025

Partially addresses: #7286

This reverts commit 20bd1e7

Changes:

  • Modifies client.RecvMsg() so that successive calls after stream ends return io.EOF.
  • Adds extra state to track calls to client.recvmsg(required to return Cardinality Violation only in case zero response)

RELEASE NOTES:

  • client: Return status code INTERNAL when a server sends 0 response messages for a unary or client streaming RPC.

@Pranjali-2501 Pranjali-2501 added this to the 1.75 Release milestone Aug 19, 2025
@Pranjali-2501 Pranjali-2501 self-assigned this Aug 19, 2025
Copy link

codecov bot commented Aug 19, 2025

Codecov Report

❌ Patch coverage is 60.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.06%. Comparing base (9ac0ec8) to head (6fc6a02).
⚠️ Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
stream.go 60.00% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8523      +/-   ##
==========================================
+ Coverage   81.82%   82.06%   +0.24%     
==========================================
  Files         413      412       -1     
  Lines       40518    40462      -56     
==========================================
+ Hits        33153    33205      +52     
+ Misses       5989     5888     -101     
+ Partials     1376     1369       -7     
Files with missing lines Coverage Δ
stream.go 81.57% <60.00%> (-0.12%) ⬇️

... and 236 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@arjan-bal
Copy link
Contributor

Can you please keep the revert commit as part of the PR? This will make it easier to review only the new changes.

Also, could you please update the PR title to accurately reflect what is being changed? Since this is an impure rollforward, the current title is a bit misleading. You can mention that it's rolling forward the reverted changes in the PR description.

Finally, please add release notes for these changes.

Thanks!

@arjan-bal arjan-bal assigned Pranjali-2501 and unassigned arjan-bal Aug 21, 2025
@Pranjali-2501 Pranjali-2501 changed the title grpc: Roll-forward: Restore changes from PR #8278 (Reverted by #8404) grpc: Roll-forward PR #8278(with changes): Restore the existing behaviour to return io.EOF on repeated client.RecvMsg() calls for non-server-streaming RPCs. Aug 22, 2025
@dfawley dfawley changed the title grpc: Roll-forward PR #8278(with changes): Restore the existing behaviour to return io.EOF on repeated client.RecvMsg() calls for non-server-streaming RPCs. client: Roll-forward PR #8278(with changes): Restore the existing behavior to return io.EOF on repeated RecvMsg() calls for client-streaming RPCs Aug 25, 2025
Copy link
Member

@dfawley dfawley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor grammar nit otherwise LGTM


// Tests that a client receives a cardinality violation error for client-streaming
// RPCs if the server call SendMsg multiple times.
// RPCs if the server call SendMsg() multiple times.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// RPCs if the server call SendMsg() multiple times.
// RPCs if the server calls SendMsg() multiple times.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor

@arjan-bal arjan-bal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a minor comment.

stream.go Outdated

sentLast bool // sent an end stream

recvFirstMsg bool // set after the first message is received
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Please expand recv to received. The abbreviation is a bit ambiguous and could be interpreted as either receive or received.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@arjan-bal arjan-bal assigned Pranjali-2501 and unassigned arjan-bal Aug 25, 2025
@Pranjali-2501 Pranjali-2501 merged commit 39400b9 into grpc:master Aug 25, 2025
15 checks passed
eshitachandwani pushed a commit to eshitachandwani/grpc-go that referenced this pull request Aug 29, 2025
… behavior to return io.EOF on repeated RecvMsg() calls for client-streaming RPCs (grpc#8523)

Partially addresses: grpc#7286

This reverts commit
grpc@20bd1e7

Changes:
- Modifies client.RecvMsg() so that successive calls after stream ends
return io.EOF.
- Adds extra state to track calls to client.recvmsg(required to return
Cardinality Violation only in case zero response)

RELEASE NOTES:
* client: Return status code INTERNAL when a server sends 0 response
messages for a unary or client streaming RPC.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants