InternalSubChannel doesn't comply with the connectivity state spec
- Lingua principale
- Java
- Stelle
- 12.1k
- Fork
- 4k
- Merge medio
- 2g 17h
- PR unite (30g)
- 37
Descrizione
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.
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.