hertz icon indicating copy to clipboard operation
hertz copied to clipboard

Hertz应该在接收到 SIGTERM 系统信号时也默认触发优雅退出而不是立即退出 【后续:该issue已解决,但建议官方及时更新文档】

Open ResilientSZUer opened this issue 1 year ago • 2 comments

Hertz现在的官方文档中的优雅关闭(https://www.cloudwego.io/zh/docs/hertz/tutorials/basic-feature/graceful-shutdown/)是这样的: Hertz 使用 waitSignal 函数作为信号处理的默认实现方式,处理如下: 当接收到 SIGTERM 系统信号时触发立即退出。 当接收到 SIGHUP|SIGINT 系统信号时触发优雅退出。

但是在现代的容器化部署环境(如 Kubernetes)中,SIGTERM才是通知容器/服务需要优雅关闭的标准信号(见下方参考资料),Hertz这样设计真让人迷惑。建议在接收到 SIGTERM 系统信号时也默认触发优雅退出而不是立即退出。

参考资料: https://aleiwu.com/post/tidb-opeartor-webhook/ https://imroc.cc/kubernetes/best-practices/graceful-shutdown/sigterm https://zhuanlan.zhihu.com/p/673323575 https://blog.hdls.me/16582138955863.html

ResilientSZUer avatar Apr 13 '25 04:04 ResilientSZUer

飞书的Cloudwego用户群已有回复: “历史问题。在0.9.6版本中已经修复。文档还没有更新。”

建议官方及时更新文档,谢谢!

ResilientSZUer avatar Apr 13 '25 04:04 ResilientSZUer

This issue has been marked as invalid question, please give more information by following the issue template. The issue will be closed in 1 days if no further activity occurs.

github-actions[bot] avatar Apr 13 '25 08:04 github-actions[bot]