Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

`Change graceful_shutdown function behavior` PR can cause tonic servers to hang `serve_with_incoming_shutdown` in two different cases

未关闭
#4,170 4 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 3 天内回复

@seanmonstar 已经在做这个了。

开始于 2026年8月27日。

评估

这个 Issue 还没有评估数据。

描述

A-http2 C-bug
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

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

hyperium/hyper 的其他 Issue

查看 hyperium/hyper 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。