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

2.5.x version smooth restart error #3179

Closed
openthe88 opened this issue Nov 27, 2023 · 2 comments · Fixed by #3195
Closed

2.5.x version smooth restart error #3179

openthe88 opened this issue Nov 27, 2023 · 2 comments · Fixed by #3195
Labels
bug It is confirmed a bug, but don't worry, we'll handle it. discuss We need discuss to make decision.

Comments

@openthe88
Copy link

框架版本从2.4.4 => 2.5.4后平滑重启不可用

执行命令
kill -SIGUSR1 进程ID

报错信息
f2240f8b1b62f145f8815d3b6301e421

2023-11-27 17:42:21.215 [ERROJ 21922: fork process failed, error:exec: no command, i"default":t"http":":2376#3","http
$":""}}
2023-11-27 17:42:21.215 21922: server restarts faile

@Issues-translate-bot Issues-translate-bot changed the title 2.5.x版本平滑重启报错 2.5.x version smooth restart error Nov 27, 2023
@huadream
Copy link

huadream commented Dec 2, 2023

if err := restartWebServers(ctx, sig, ""); err != nil {

restartWebServers 第三个参数newExeFilePath不能为""
因为最终调用的这个方法填了newExeFilePath就会替换掉默认值

func forkReloadProcess(ctx context.Context, newExeFilePath ...string) error {
var (
path = os.Args[0]
)
if len(newExeFilePath) > 0 {
path = newExeFilePath[0]
}
var (

可以改成os.Args[0]

我个人比较建议直接自己实现一个路由调用 ghttp.RestartAllServer(ctx, os.Args[0])

@Issues-translate-bot
Copy link

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


if err := restartWebServers(ctx, sig, ""); err != nil {

restartWebServers The third parameter newExeFilePath cannot be ""
Because the method that is finally called fills in newExeFilePath, it will replace the default value.

func forkReloadProcess(ctx context.Context, newExeFilePath ...string) error {
var (
path = os.Args[0]
)
if len(newExeFilePath) > 0 {
path = newExeFilePath[0]
}
var (

Can be changed to os.Args[0]

I personally recommend directly implementing a routing call ghttp.RestartAllServer(ctx, os.Args[0])

@houseme houseme added the discuss We need discuss to make decision. label Dec 11, 2023
@hailaz hailaz added the bug It is confirmed a bug, but don't worry, we'll handle it. label Dec 12, 2023
@hailaz hailaz mentioned this issue Dec 12, 2023
gqcn pushed a commit that referenced this issue Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It is confirmed a bug, but don't worry, we'll handle it. discuss We need discuss to make decision.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants