treasure-data / serverengine

A framework to implement robust multiprocess servers like Unicorn
Apache License 2.0
759 stars 86 forks source link

Treat worker unexpected shutdown as Warn log level #136

Closed daipom closed 1 year ago

daipom commented 1 year ago

This log level was changed to ERROR by the fix: #113.

However, this log is outputted when using SIGHUP, so ERROR is too strong. Leave it as Warn as an adjustment for now.

Before

2022-11-29 18:47:47 +0900 [error]: fluent/log.rb:372:error: Worker 0 finished unexpectedly with status 0

After

2022-11-29 18:45:42 +0900 [warn]: fluent/log.rb:351:warn: Worker 0 finished unexpectedly with status 0
ashie commented 1 year ago
fluent/log.rb:372:error: Worker 0 finished unexpectedly with status 0

I think we should change the severity according to the status. In the above example, it should be info since the status is 0. I'll check it.

ashie commented 1 year ago

I've added a commit to treat exit status 0 as INFO (otherwise ERROR as before). Could you check it? @daipom @fujimotos

daipom commented 1 year ago

@ashie Thanks for the fix! I have checked this solves #113. LGTM.

fujimotos commented 1 year ago

I've added a commit to treat exit status 0 as INFO (otherwise ERROR as before).

I pulled the changeset to my tree this morning. I'm going to peform more tests on this. Wait for me.

fujimotos commented 1 year ago

I pulled the changeset to my tree this morning. I'm going to peform more tests on this. Wait for me.

OK. I checked out this branch in combination with the latest Fluentd tree. It basically worked: sending HUP to the supervisor terminated workers gracefully, while kill -9 <worker_id> causes an error.

So I merged this in a38bbb715, with a small fix on log messages.