Class: Fluent::EngineClass

Inherits:
Object
  • Object
show all
Defined in:
lib/flydata/fluent-plugins/in_mysql_binlog_flydata.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


26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/flydata/fluent-plugins/in_mysql_binlog_flydata.rb', line 26

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