Skip to content

rpc: reject empty batch in BatchCallContext#2713

Merged
ucwong merged 1 commit into
masterfrom
dev
Jun 1, 2026
Merged

rpc: reject empty batch in BatchCallContext#2713
ucwong merged 1 commit into
masterfrom
dev

Conversation

@ucwong
Copy link
Copy Markdown
Member

@ucwong ucwong commented Jun 1, 2026

The server already rejects empty batches with -32600. On the client side, calling BatchCallContext with a zero-length slice on inproc/WS/IPC transports registers no request IDs but the server still replies with an error message whose id is null. The dispatch loop has no requestOp to match it to, so op.resp is never written and op.wait blocks until ctx deadline.

Short-circuit on len(b) == 0 with the same invalidRequestError the server uses, so all transports return immediately with -32600.

The server already rejects empty batches with -32600. On the client
side, calling BatchCallContext with a zero-length slice on inproc/WS/IPC
transports registers no request IDs but the server still replies with an
error message whose id is null. The dispatch loop has no requestOp to
match it to, so op.resp is never written and op.wait blocks until ctx
deadline.

Short-circuit on len(b) == 0 with the same invalidRequestError the
server uses, so all transports return immediately with -32600.
@ucwong ucwong marked this pull request as ready for review June 1, 2026 07:32
@ucwong ucwong merged commit 89a9989 into master Jun 1, 2026
1 check passed
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