Skip to content

Commit

Permalink
add a RPC call to flush buffers and stop workers
Browse files Browse the repository at this point in the history
  • Loading branch information
tagomoris committed Aug 1, 2016
1 parent 26eebdb commit b46e652
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/fluent/supervisor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ def run_rpc_server
Process.kill :TERM, $$
nil
}
@rpc_server.mount_proc('/api/processes.flushBuffersAndKillWorkers') { |req, res|
$log.debug "fluentd RPC got /api/plugins.flushBuffersAndKillWorkers request"
if Fluent.windows?
$log.warn "operation 'flushBuffersAndKillWorkers' is not supported on Windows now."
else
Process.kill :USR1, $$
Process.kill :TERM, $$
end
nil
}
@rpc_server.mount_proc('/api/plugins.flushBuffers') { |req, res|
$log.debug "fluentd RPC got /api/plugins.flushBuffers request"
unless Fluent.windows?
Expand Down

0 comments on commit b46e652

Please sign in to comment.