Skip to content

Fix: Write method in localfile server to return stream closure instead of nil#611

Merged
sfc-gh-pkowalewski merged 1 commit intomainfrom
pkowalewski-fix-stream-closure
Mar 12, 2026
Merged

Fix: Write method in localfile server to return stream closure instead of nil#611
sfc-gh-pkowalewski merged 1 commit intomainfrom
pkowalewski-fix-stream-closure

Conversation

@sfc-gh-pkowalewski
Copy link
Copy Markdown
Collaborator

@sfc-gh-pkowalewski sfc-gh-pkowalewski commented Mar 11, 2026

Returning nil without calling SendAndClose on a client-streaming RPC is a protocol violation, the client expects a response message. Depending on the gRPC implementation and client behavior, the old code could have caused the client to receive an error (e.g., io.EOF without a response) or behave unpredictably on success. This fix ensures the client reliably receives a proper success acknowledgment.

This is a bug fix as it aligns Write with the correct gRPC client-streaming pattern (receive messages, then SendAndClose with a response) which is enforced by newer versions of go/grpc.

@sfc-gh-pkowalewski sfc-gh-pkowalewski marked this pull request as ready for review March 12, 2026 10:54
@sfc-gh-pkowalewski sfc-gh-pkowalewski merged commit e431433 into main Mar 12, 2026
6 checks passed
@sfc-gh-pkowalewski sfc-gh-pkowalewski deleted the pkowalewski-fix-stream-closure branch March 12, 2026 11:53
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.

2 participants