Skip to content

binder: Defer server close until suffix send completes - #13117

Open
kkmurthyt21 wants to merge 1 commit into
grpc:masterfrom
kkmurthyt21:binder-13097-deferred-close
Open

kkmurthyt21 wants to merge 1 commit into
grpc:masterfrom
kkmurthyt21:binder-13097-deferred-close

Conversation

@kkmurthyt21

Copy link
Copy Markdown
Contributor

Fixes #13097.

Summary

This change fixes Android Binder server-stream cleanup when closing a stream is deferred by transport flow control.

Previously, the server could notify the application that the stream had closed before the suffix transaction was sent. If the deferred transmission subsequently failed, the call could remain registered, and readiness callbacks could be delivered after closure.

The changes:

  1. Defers successful stream closure until the suffix transaction is sent.
  2. Ensures deferred-send failures trigger abnormal cleanup and call unregistration.
  3. Prevents readiness callbacks after terminal closure.
  4. Handles both single-message and multi-message server streams.
  5. Adds Robolectric regression coverage for deferred sends, transport failures, cancellation, and callback ordering.

Test results

  1. Targeted regression tests: 20 passed.
  2. Full Binder suite: 510 tests, 493 passed, 17 ignored, 0 failures.
  3. Checkstyle task: BUILD SUCCESSFUL.
  4. Git whitespace validation: passed.

Note: No physical Android device or emulator testing was performed.

@linux-foundation-easycla

linux-foundation-easycla Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: kkmurthyt21 / name: kkmurthyt21 (4b2dd4d)

This branch has not been deployed

No deployments
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.

binder: ServerStream.close() marks the stream closed before the suffix is sent, so a flow-control-deferred send failure leaks the call

1 participant