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

Resolve unexpected exit on SIGUSR1 #1957

Merged
merged 2 commits into from
Apr 27, 2018

Conversation

abicky
Copy link
Contributor

@abicky abicky commented Apr 18, 2018

This PR resolves #1951.

Before

% git rev-parse HEAD
59d96759253c3894d7a7d398f2647f218ffdae18
% bundle exec ./bin/fluentd -c ./fluent.conf --log /tmp/fluent.log --log-rotate-age 1 --log-rotate-size 1024 &
[1] 19569
% kill -USR1 19569
Unexpected error wrong number of arguments (given 2, expected 0..1)
  /Users/arabiki/.anyenv/envs/rbenv/versions/2.4.2/lib/ruby/2.4.0/logger.rb:715:in `reopen'
  /Users/arabiki/ghq/src/github.com/fluent/fluentd/lib/fluent/supervisor.rb:364:in `reopen!'
  /Users/arabiki/ghq/src/github.com/fluent/fluentd/lib/fluent/supervisor.rb:163:in `supervisor_sigusr1_handler'
  /Users/arabiki/ghq/src/github.com/fluent/fluentd/lib/fluent/supervisor.rb:137:in `block in install_supervisor_signal_handlers'
  /Users/arabiki/.anyenv/envs/rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/serverengine-2.0.6/lib/serverengine/process_manager.rb:252:in `select'
  /Users/arabiki/.anyenv/envs/rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/serverengine-2.0.6/lib/serverengine/process_manager.rb:252:in `tick'
  /Users/arabiki/.anyenv/envs/rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/serverengine-2.0.6/lib/serverengine/multi_spawn_server.rb:91:in `wait_tick'
  /Users/arabiki/.anyenv/envs/rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/serverengine-2.0.6/lib/serverengine/multi_worker_server.rb:60:in `run'
  /Users/arabiki/.anyenv/envs/rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/serverengine-2.0.6/lib/serverengine/multi_spawn_server.rb:57:in `run'
  /Users/arabiki/.anyenv/envs/rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/serverengine-2.0.6/lib/serverengine/server.rb:123:in `main'
(snip)

After

% bundle exec ./bin/fluentd -c ./fluent.conf --log /tmp/fluent.log --log-rotate-age 1 --log-rotate-size 1024 &
[1] 19163
% kill -USR1 19163
% tail -2 /tmp/fluent.log
2018-04-18 20:46:19 +0900 [info]: #0 force flushing buffered events
2018-04-18 20:46:19 +0900 [info]: #0 flushing all buffer forcedly

abicky added 2 commits April 18, 2018 20:52
Logger::LogDevice#reopen accepts only 0 or 1
arguments.

Signed-off-by: abicky <[email protected]>
Otherwise an error occurs like
"Unexpected error can't be called from trap context".

Signed-off-by: abicky <[email protected]>
@abicky abicky force-pushed the resolve-unexpected-exist-on-sigusr1 branch from d267811 to 52a45e2 Compare April 18, 2018 11:53
@abicky abicky changed the title Resolve unexpected exist on SIGUSR1 Resolve unexpected exit on SIGUSR1 Apr 18, 2018
@repeatedly repeatedly added bug Something isn't working v1 labels Apr 18, 2018
@repeatedly repeatedly merged commit 5898965 into fluent:master Apr 27, 2018
@repeatedly
Copy link
Member

Confired. Thanks for the patch!

@abicky abicky deleted the resolve-unexpected-exist-on-sigusr1 branch April 27, 2018 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fluentd exits on SIGUSR1 if its logrotate feature is enabled
2 participants