0xMiden / 0xMiden/node

Default gRPC server max connection age causes long-lived subscriptions to be closed periodically

オープン
#2,273 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Rust
スター
104
フォーク
138
平均マージ
1日 13時間
マージ済み PR(30日)
56

説明

### 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_

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。