Graceful exit has not taken effect
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, node.js
调研方向
使用 router.js 和 index.js 复现该问题:运行 node index.js,启动持续三秒的 /test 请求,并向 htop 中识别出的进程发送 SIGTERM。首先跟踪 egg-cluster 的 startCluster 入口点及其信号处理。完成的标准是,在 Egg 服务器关闭之前,正在传输中的请求收到成功响应。
由索引模型根据 Issue 内容生成。
描述
Version:
system: macOS 14.4.1
node: 20.12.2
"egg": "^3.17.5",
"egg-cluster": "^2.2.1",
Minimal Code Example:
npx egg-init --type simple
// router.js
module.exports = app => {
const { router, controller } = app;
router.get('/', controller.home.index);
// add a router has a 3 seconds aysnc job
router.get("/test", async (ctx) => {
await new Promise((resolve) => {
setTimeout(() => {
resolve(1);
}, 3000);
});
ctx.body = "test";
})
};
// index.js
const startCluster = require('egg-cluster').startCluster;
startCluster({
baseDir: __dirname,
workers: 2,
port: 7001,
});
- start command: node index.js
- find node index.js
pidin htop - curl -v http://127.0.0.1:7001/api/v1/test
- send SIGTERM signal to pid filter in step 2
Expected: The request in step 3 has a successful response, EGG server closes after handling in transit connection.
Actually: the connection is closed immediately after the SIGTERM signal send.
- 主要语言
- JavaScript
- 星标
- 222
- 派生
- 52
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
documentation good first issue help wanted
难度 1/5 1-3 小时 新手友好度 85/100
zmo2s/agent-toolbox#23 ·
-
[Bug]: [MCP/CLI] Bare loopback IP addresses (127.0.0.1:port) and hosts with ports fail to navigate due to erroneous scheme inference可能已有人在做 @alok-108 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
microsoft/playwright#43263 ·
维护者通常 1 天内回复
-
bug traffic
难度 2/5 1 小时以内 新手友好度 74/100