`Change graceful_shutdown function behavior` PR can cause tonic servers to hang `serve_with_incoming_shutdown` in two different cases
维护者通常 3 天内回复
@seanmonstar 已经在做这个了。
开始于 2026年8月27日。
评估
这个 Issue 还没有评估数据。
描述
Version
Foudn in hyper 1.5.1 and later
Platform
25.5.0 (macOS), though it is also applying on our linux bots
Summary
At OneSignal we have a number of tonic gRPC services we maintain. After a recent update of dependencies on one of them, we noticed that it "randomly" would hang during shutdown for an hour or more.
After a week of chasing the wild goose, we have isolated it to a single PR introduced in hyper 1.5.1:
https://github.com/hyperium/hyper/pull/3729
In these cases a tonic server:
Server::builder()
.add_service(GreeterServer::new(MyGreeter::default()))
.serve_with_incoming_shutdown(incoming, async move {
shutdown_grpc_token.cancelled().await
})
.await
.unwrap();
would never return and block for an hour or more after the shutdown_grpc_token CancellationToken was canceled.
We have a primary example non_upgrade_connections_can_block_shutdown and a secondary one we found along the way client_not_responding_example in this self contained example:
https://github.com/chamons/hyper_hung_client_example
With a patch.crates-io line, we can resolve this branch with the PR reverted and both of these example begin acting as expected.
Expected Behavior
It is not expected that passive tonic gRPC connections to a server that are unused would block shutdown. Before 1.5.1 they did not.
Actual Behavior
We block until the upstream instance restarts or otherwise drops all of its connections.
Additional Context
No response
- 主要语言
- Rust
- 星标
- 16.3k
- 派生
- 1.8k
- 平均合并
- 2 天 20 小时
- 30 天内合并 PR
- 14
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
hyperium/hyper 的其他 Issue
-
C-feature
难度 1/5 1 小时以内 新手友好度 65/100
hyperium/hyper#2652 · 4 个 reaction ·
维护者通常 3 天内回复
-
难度 4/5 3-5 天 新手友好度 62/100
维护者通常 3 天内回复
-
C-feature
难度 5/5 一周以上 新手友好度 35/100
维护者通常 3 天内回复
-
HTTP/1 client connection is never closed or pooled when a response completes while the request body is still unsent ((Reading::KeepAlive, Writing::Body) is a terminal state)可能已有人在做 @BlackRabbitCoder 于 12 天前认领。 未关闭C-bug S-waiting-on-author
hyperium/hyper#4176 · 4 条评论 · 已指派 1 人 ·
维护者通常 3 天内回复
-
C-bug
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 3 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 92/100
bytecodealliance/wasmtime#14433 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复