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

the behavior when start_server receives multiple HUP signals #9

Open
harukasan opened this issue Nov 25, 2016 · 8 comments
Open

the behavior when start_server receives multiple HUP signals #9

harukasan opened this issue Nov 25, 2016 · 8 comments

Comments

@harukasan
Copy link
Contributor

go-server-starter implements the different to Server::Starter's one.

p5-server-starter behavior:

         old workers   action
-------  ------------  ----------------------------------------------------
1st HUP             0  spawn new worker and send TERM signal to old workers
2nd HUP             1  spawn new worker and send TERM signal to old workers
3rd HUP             2  spwan new worker and send TERM signal to old workers (stop one)
4th HUP             2  ...

go-server-starter behavior:

         old workers   action
-------  ------------  ----------------------------------------------------
1st HUP             0  spawn new worker and send TERM signal to old workers
2nd HUP             1  no action
3nd HUP             1  no action (stop one old worker)
4th HUP             0  spawn new worker and send TERM signal to old workers
                       when the all old worker exit.

I want to use the original perl's behavior with go-server-starter.

I also notice that restart = 2 is not used for now. Should we implement other options and set restart = 2?

@lestrrat
Copy link
Collaborator

I can appreciate that there's a difference, but I'm having trouble deciphering what the table you show represent.

  • What's the "old workers" represent here?
  • Is this really a problem with the number of signals, or a timing issue?
  • I read the original p5 code, and I can't see restart = 2 now, has it been deprecated?

@harukasan
Copy link
Contributor Author

"old workers" represents the number of remain workers which includes oldWorkers list.
My interest is the number of signals sending to old workers and I want to send the signal to old workers when send HUP to start_server again.

I just found restart = 2 in go-server-starter (I don't know the old p5 code).

@lestrrat
Copy link
Collaborator

申し訳ないですが、日本語でどうぞ!↑の説明、多分文章の時制がはっきりしてないせいで、どのタイミングで何が起こるべきだと言われてるのか全くわからないです…

@harukasan
Copy link
Contributor Author

うまく伝わらなくてすいません。。

やりたいこととしては、HUPシグナルを再度送ったときに、workerがまだ死んでいなければ、再度死んでないworkerにTERMシグナルを送ることです。 p5の場合、HUPを送ると新しいプロセスの起動とTERMシグナルの送信を繰り返すので、これと同じ挙動であれば問題ありません(新しいプロセスが起動されるかどうかは問題にしていないので、起動されなくてもかまいません)。

@lestrrat
Copy link
Collaborator

なるほど、なるほど。わかりました!
ちょっとこれから退席しなければいけないので次の返信は遅くなりますが、その間にコード見ておきます!

@lestrrat
Copy link
Collaborator

おまたせしました。 #11 の感じでどうでしょうかねぇ

@harukasan
Copy link
Contributor Author

@lestrrat すいません!いまみました、今日夜以降確認しますので、明日コメントさせて頂きます

@lestrrat
Copy link
Collaborator

@harukasan ping?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants