Skip to content

Commit

Permalink
Merge pull request #1134 from fluent/rpc-call-flush-and-stop
Browse files Browse the repository at this point in the history
add a RPC call to flush buffers and stop workers
  • Loading branch information
tagomoris authored Aug 1, 2016
2 parents ab92993 + 8507b3c commit 3213d10
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/processes.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 3213d10

Please sign in to comment.