Class: Fluent::EngineClass

Inherits:
Object
  • Object
show all
Defined in:
lib/flydata/fluent-plugins/flydata_plugin_ext/flush_support.rb

Overview

Monkey-patch fluentd class (EngineClass) to support shutdown for input plugin. This will be called when USR1 signal is received

Instance Method Summary collapse

Instance Method Details

#shutdown_sourceObject

Send shutdown to all the sources


7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/flydata/fluent-plugins/flydata_plugin_ext/flush_support.rb', line 7

def shutdown_source
  @sources.map {|s|
    Thread.new do
      begin
        s.shutdown
      rescue => e
        $log.warn "unexpected error while shutting down", :error_class=>e.class, :error=>e
        $log.warn_backtrace
      end
    end
  }.each {|t|
    t.join
  }
end