server-starter icon indicating copy to clipboard operation
server-starter copied to clipboard

the behavior when start_server receives multiple HUP signals

Open harukasan opened this issue 9 years ago • 8 comments

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?

harukasan avatar Nov 25 '16 05:11 harukasan

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?

lestrrat avatar Nov 25 '16 05:11 lestrrat

"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).

harukasan avatar Nov 25 '16 06:11 harukasan

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

lestrrat avatar Nov 25 '16 06:11 lestrrat

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

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

harukasan avatar Nov 25 '16 06:11 harukasan

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

lestrrat avatar Nov 25 '16 06:11 lestrrat

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

lestrrat avatar Nov 29 '16 11:11 lestrrat

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

harukasan avatar Dec 05 '16 06:12 harukasan

@harukasan ping?

lestrrat avatar Dec 12 '16 22:12 lestrrat