Skip to content

Revert "core: Delayed deserialization for unary/server-streaming calls (#13004) - #13107

Merged
kannanjgithub merged 1 commit into
grpc:masterfrom
kannanjgithub:revert-delayed-deserialization-after-halfclose
Oct 9, 2026
Merged

kannanjgithub merged 1 commit into
grpc:masterfrom
kannanjgithub:revert-delayed-deserialization-after-halfclose

Conversation

@kannanjgithub

Copy link
Copy Markdown
Contributor

This reverts commit 8ba4b48 because this change breaks grpc-kotlin tests that use InProcessTransport by causing a deadlock because ServerCalls.kt only requests the next message after onMessage delivers the current one, and messages get queued because the client hasn't called halfClose yet. When the client halfCloses, InProcessTransport.halfClose defers delivering halfClose if the server's receive queue is non-empty.

Resulting Deadlock:

  • ServerCallImpl waits for halfClosed() before dispatching Message 1.
  • InProcessTransport waits for call.request(1) before dispatching halfClosed().
  • The server waits for Message 1 before calling call.request(1).
  • The test hangs indefinitely waiting for closeStatus.await() until the 10s test timeout expires.

There are a few other failures too but those can be fixed in the test code alone.

Internal Test failures: http://shortn/_If0NinnwQ4

@kannanjgithub
kannanjgithub merged commit 6d5848c into grpc:master Oct 9, 2026
18 checks passed
kannanjgithub added a commit that referenced this pull request Oct 12, 2026
#13004) (v1.84.x backport) (#13110)

Backport of #13107 to v1.84.x.
---
This reverts commit 8ba4b48 because
this change breaks grpc-kotlin tests that use InProcessTransport by
causing a deadlock because
[ServerCalls.kt](https://github.com/grpc/grpc-kotlin/blob/master/stub/src/main/java/io/grpc/kotlin/ServerCalls.kt#L214-L215)
only requests the next message after `onMessage` delivers the current
one, and messages get queued because the client hasn't called
`halfClose` yet. When the client halfCloses,
`InProcessTransport.halfClose`
[defers](https://github.com/grpc/grpc-java/blob/master/inprocess/src/main/java/io/grpc/inprocess/InProcessTransport.java#L904)
delivering halfClose if the server's receive queue is non-empty.

**Resulting Deadlock:**
- `ServerCallImpl` waits for `halfClosed()` before dispatching Message
1.
- `InProcessTransport` waits for `call.request(1)` before dispatching
`halfClosed()`.
  - The server waits for Message 1 before calling `call.request(1)`.
- The test hangs indefinitely waiting for `closeStatus.await()` until
the 10s test timeout expires.

There are a few other failures too but those can be fixed in the test
code alone.

Internal Test failures: http://shortn/_If0NinnwQ4
kannanjgithub added a commit that referenced this pull request Oct 13, 2026
Restore delayed deserialization and lazy decompression for unary and
server-streaming calls (originally introduced in #13004 and reverted in
#13107).

Additionally, convert ServerCall.request(1) to stream.request(2) for
unary and server-streaming calls (clientSendsOneMessage()) to prevent
transport deadlocks if multiple messages arrive on the stream.
kannanjgithub added a commit that referenced this pull request Oct 19, 2026
….x backport) (#13132)

Backport of #13113 to v1.85.x.
---
Restore delayed deserialization and lazy decompression for unary and
server-streaming calls (originally introduced in #13004 and reverted in
#13107).

Additionally, convert ServerCall.request(1) to stream.request(2) for
unary and server-streaming calls (clientSendsOneMessage()) to prevent
transport deadlocks if multiple messages arrive on the stream.
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