Method: Fluent::Plugin::Output#before_shutdown

Defined in:
lib/fluent/plugin/output.rb

#before_shutdownObject



537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
# File 'lib/fluent/plugin/output.rb', line 537

def before_shutdown
  @secondary.before_shutdown if @secondary

  if @buffering && @buffer
    if @flush_at_shutdown
      force_flush
    end
    @buffer.before_shutdown
    # Need to ensure to stop enqueueing ... after #shutdown, we cannot write any data
    @output_enqueue_thread_running = false
    if @output_enqueue_thread && @output_enqueue_thread.alive?
      @output_enqueue_thread.wakeup
      @output_enqueue_thread.join
    end
  end

  super
end