Default gRPC server max connection age causes long-lived subscriptions to be closed periodically
- Lingua principale
- Rust
- Stelle
- 104
- Fork
- 138
- Merge medio
- 1g 13h
- PR unite (30g)
- 56
Descrizione
### Node's components affected by this task
- [x] RPC
- [ ] Block producer
- [ ] Store
- [ ] Network transaction builder
- [ ] Remote prover
- [ ] Protobuf messages
- [ ] Testing
### What should be done?
We're configuring [max connection age](https://docs.rs/tonic/latest/tonic/transport/struct.Server.html#method.max_connection_age) for our RPC API. Since that API now includes long-lived subscriptions for block and proof subscriptions this is maybe not a good idea. The exact max age is configurable, the default is 30 minutes which is fairly low to cause observable force-reconnects for clients.
### How should it be done?
I assume that the reason for configuring a max age was making sure that connections where the client has became unreachable are timing out eventually.
Ideally we'd close _idle_ connections after a configurable timeout. However, `tonic` does not seem to have a configuration option for doing that.
HTTP/2 keep-alives can be enabled by [`http2_keepalive_interval`](https://docs.rs/tonic/latest/tonic/transport/struct.Server.html#method.http2_keepalive_interval) but since we're not on HTTP/2 exclusively that might just be insufficient.
### When is this task done?
The task is done when:
- either connection-max-age setting is gone and we have a replacement mechanism guaranteeing that connections where the client is unreachable are timing out eventually,
- or we have determined that `tonic` provides no better solution than configuring `connection_max_age`.
### Additional context
_No response_
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.