0xMiden / 0xMiden/node

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

Đang mở
#2,273 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Rust
Star
104
Fork
138
Merge trung bình
1 ngày 13 giờ
Pull request đã merge (30 ngày)
56

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.