grpc / grpc/grpc-java

binder: Inbound.java reassembly logic needlessly handles out-of-order transactions, fails to handle silently dropped ones.

Open
#12,747 0 comments 0 reactions 0 assignees View on GitHub
binder
Dominant language
Java
Stars
12.1k
Forks
4k
Avg merge
2d 17h
Merged PRs (30d)
37

Description

[Inbound](https://github.com/grpc/grpc-java/blob/master/binder/src/main/java/io/grpc/binder/internal/Inbound.java) has code to handle Binder transactions delivered out-of-order, something that can't happen (see [IBinder#FLAG_ONEWAY](https://developer.android.com/reference/android/os/IBinder#flag_oneway)). At the same time, it fails to handle the rare case where transactions are [silently dropped](http://g/android-chatty-eng/c/9iA4FIVKeBs/m/wyxJFGuMBAAJ).

We should simplify the message reassembly code and fail fast on gaps instead of waiting forever for a transaction that will never come. If an incoming transaction index doesn't have the next expected value, immediately close the stream (with `DATA_LOSS`? `UNAVAILABLE`?). This avoids a hang, allowing callers to retry sooner.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.