Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

进程退出时存在资源释放流程不正确 #2286

Closed
chengyu-l opened this issue Jan 10, 2024 · 0 comments
Closed

进程退出时存在资源释放流程不正确 #2286

chengyu-l opened this issue Jan 10, 2024 · 0 comments
Assignees
Labels
☢️ Bug Something isn't working

Comments

@chengyu-l
Copy link
Contributor

Is this a regression?

Yes

Description

image

pika通过信号监听实现优雅退出,在优雅退出时,PikaServer的析构函数也不一定会执行。目前在信号监听回调只是设置了一下PikaServer exit 的标记位,这种方式释放资源可能达不到预期效果。

前台运行,执行ctl+c 结束执行,日志输出如下:
image

daemon运行,执行kill pid (非-9模式)结束执行,日志输出如下:
image

image

正确的关闭流程应该是如下步骤:
(1)停止接受新的客户端读写请求
(2)停止接受新的Slave主从同步请求
(3)检查并等待存量请求完成处理,并返回客户端响应
(4)关闭所有客户端连接
(5)中止全量同步(如果有全量同步请求,不推荐停止服务)
(6)检查并等待binlog完成同步(设置超时时间)
(7)关闭所有Slave连接

Please provide a link to a minimal reproduction of the bug

No response

Screenshots or videos

No response

Please provide the version you discovered this bug in (check about page for version information)

No response

Anything else?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☢️ Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants