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

Allow accepting new connections during a graceful shutdown

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
rust
领域
networking

调研方向

先阅读 hyper's proto/h1/dispatch.rs 和 proto/h1/conn.rs 中引用的 Rust 位置,然后阅读 hyper-util's server/conn/auto/mod.rs。跟踪取消和优雅关闭如何影响新连接和可升级连接;当提议的 flag 支持在初始关闭窗口期间接受连接,同时应用 GOAWAY 或 connection: close,并在最短截止时间之后停止接受连接时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

B-rfc C-feature

Is your feature request related to a problem? Please describe.
We want a very specific behavior for graceful shutdowns in our hyper-based proxy. We set two deadlines, min (typically 5-10s), and max (could be much longer). We want the following sequence during shutdown:

  • t=0s: send GOAWAY on all HTTP2 connections and start responding with connection: close on all http1 requests. Continue to accept new connections, and handle them the same (GOAWAY/connection: close) them.
  • After min deadline: stop accepting new connections. Continue existing connections, with the same GOAWAY/connection: close.
  • After max deadline: shutdown everything.

The reason for the time when we accept new connections, but tell clients to go away, is that there is some time for the load balancers in front of the proxy (this could be something like AWS NLB, Kubernetes kube-proxy, etc) to de-register the proxy instance and stop sending traffic to it. So immediately dropping new connections results in downtime. However, during this time its nice to start to encourage clients to goaway, since its likely they will select another proxy instance (either because the fronting LB already de-registered the old instance (the min deadline is intended to be the worst case, so usually its much faster), or because of random chance it selects a different one).

Today, the best we can do is wait until after min deadline and stop accepting new connections and start GOAWAY/connection: close at the same time.

Describe the solution you'd like
A new flag on hyper_util::server::conn::auto, and on hyper::server::conn::http1 to enable the "different graceful shutdown mode" (naming TBD!). This would change:

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context

If these changes are acceptable I would be happy to contribute both parts of the change

主要语言
Rust
星标
16.4k
派生
1.8k
平均合并
2 天 9 小时
30 天内合并 PR
14

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

hyperium/hyper 的其他 Issue

查看 hyperium/hyper 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

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