grpc / grpc/grpc-java

InternalSubChannel doesn't comply with the connectivity state spec

Offen
#2,873 4 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @zhangkun83 Auf GitHub ansehen
Vorherrschende Sprache
Java
Sterne
12.1k
Forks
4k
Ø Merge
2 T. 17 Std.
Gemergte PRs (30 T.)
37

Beschreibung

When receiving a GOAWAY (`transportShutdown()` callback), `InternalSubChannel` unconditionally [transitions to `IDLE`](https://github.com/grpc/grpc-java/blob/v1.2.0/core/src/main/java/io/grpc/internal/InternalSubchannel.java#L439). However, the [spec](https://github.com/grpc/grpc/blob/v1.2.1/doc/connectivity-semantics-and-api.md) says
1. `READY` transitions to `TRANSIENT_FAILURE` on "any failure encountered while expecting successful communication on established channel."
1. "Channels that receive a GOAWAY when there are no active or pending RPCs should also switch to IDLE".

`InternalSubchannel` needs to look at the status passed to `transportShutdown()`:
- If it's not OK, according to Rule 1 above, the new state should be `TRANSIENT_FAILURE`
- If it's OK, then it's a GOAWAY.
- If the in-use state of the subchannel is `false`, according to Rule 2 above, the new state should be `IDLE`.
- Otherwise, the spec doesn't say what the new state should be. Apparently it cannot stay in `READY`. It cannot go to `TRANSIENT_FAILURE` either because it's a GOAWAY, not an error. This part of the spec should be revisited.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.