Programs using Logger sometimes resist SIGTERM / SIGINT

未关闭 适合新手
#177 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@mikamikasuki 已经在做这个了。

开始于 2026年10月2日。

  • #178 来自 @mikamikasuki —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
ruby
领域
backend

调研方向

从 issue 中链接的 lib/logger/log_device.rb 里的 Logger::LogDevice#close 开始,检查关闭期间引发的异常是如何处理的。使用 Logger 1.6 重现 SIGTERM 或 SIGINT 场景,然后添加回归测试覆盖,以表明该信号不会被静默吞掉,并且进程能够正确接收到它。

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

描述

If a ruby program logs with Logger and happens to receive a signal while executing inside Logger::LogDevice's #close method, then the signal will be silently swallowed and the process will not be killed.

For example, when a program receives SIGTERM, it will cause a SignalException to be raised. The code linked above contains rescue Exception which will capture the SignalException and silently return a nil.

The program will then continue to execute.

Reproduced with Logger 1.6.

主要语言
Ruby
星标
161
派生
76
平均合并
2 天 5 小时
30 天内合并 PR
3

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

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

ruby/logger 的其他 Issue

查看 ruby/logger 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

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