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

Graceful shutdown #2192

Closed
wxwliris opened this issue Jul 25, 2022 · 10 comments · Fixed by #3611
Closed

Graceful shutdown #2192

wxwliris opened this issue Jul 25, 2022 · 10 comments · Fixed by #3611

Comments

@wxwliris
Copy link

grpc 程序,接收到了kill信号,直接退出程序,并没等正在处理程序的协程处理结束后再退出

@kevwan kevwan changed the title 优雅关闭程序 Graceful shutdown Jul 27, 2022
@kevwan
Copy link
Contributor

kevwan commented Jul 27, 2022

Show the main function, and how to you kill the app?

@answergong
Copy link

请问您的问题找到了吗?
我自己测试http服务,ctrl_c取消程序,也是直接退出,并没等正在处理程序的协程处理结束后再退出;
我看文档说,go zero的server.Start()方法会自动处理优雅重启的啊,没找到问题

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Did you find your question?
I tested the http service myself, ctrl_c canceled the program, and also exited directly, and did not wait for the coroutine processing of the processing program to end before exiting;
I read the documentation and said that the server.Start() method of go zero will automatically handle graceful restarts, but I didn't find any problems.

@kevwan
Copy link
Contributor

kevwan commented Aug 10, 2022

ctrl-c is not going to happy in service. Use kill to trigger graceful shutdown.

@answergong
Copy link

i try to use kill pid to shutdown the prigram,but it also can not grace shut down,it still shutdow right now

@github-actions
Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Aug 11, 2023
@calvin2021y
Copy link

请问您的问题找到了吗? 我自己测试http服务,ctrl_c取消程序,也是直接退出,并没等正在处理程序的协程处理结束后再退出; 我看文档说,go zero的server.Start()方法会自动处理优雅重启的啊,没找到问题

测试最新版,仍然有这个问题。

s := rest.MustNewServer(*cfg)
s.Stop() // 执行后在进行中的请求全部立即返回了。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Did you find your problem? I tested the http service by myself, ctrl_c canceled the program, and exited directly, and did not wait for the coroutine processing of the program to finish before exiting; I read the document that go zero's server.Start( ) method will automatically handle graceful restart, no problem found

Tried the latest version and still have this problem.

s := rest.MustNewServer(*cfg)
s.Stop() // All requests in progress are returned immediately after execution.

@kevwan
Copy link
Contributor

kevwan commented Sep 5, 2023

go-zero only handles SIGTERM, because in server, you never hit ctrl-c to running services.

@kevwan
Copy link
Contributor

kevwan commented Jan 27, 2025

Supported SIGINT already.

@kevwan kevwan closed this as completed Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants