binder: Inbound.java reassembly logic needlessly handles out-of-order transactions, fails to handle silently dropped ones.
- Vorherrschende Sprache
- Java
- Sterne
- 12.1k
- Forks
- 4k
- Ø Merge
- 2 T. 17 Std.
- Gemergte PRs (30 T.)
- 37
Beschreibung
[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.
Beitragsleitfaden
Rechercherichtung
Beginnen Sie mit binder/src/main/java/io/grpc/binder/internal/Inbound.java und überprüfen Sie das im Issue verknüpfte Verhalten von IBinder#FLAG_ONEWAY. Vereinfachen Sie die Wiederzusammensetzung unter der Annahme, dass Transaktionen geordnet sind, und sorgen Sie dafür, dass ein unerwarteter Index den Stream sofort mit einem geeigneten Status schließt, statt unbegrenzt zu warten. Fertig bedeutet, dass Lücken nicht mehr dazu führen, dass Aufrufer hängen bleiben, und dass der gewählte Fehlerstatus Wiederholungsversuche unterstützt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- android, grpc, java
- Bereich
- api, backend
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100