0xMiden / 0xMiden/node

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

未关闭
#2,273 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Rust
星标
104
派生
138
平均合并
1 天 13 小时
30 天内合并 PR
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 摘要。