Method: Fluent::Plugin::Output#submit_flush_once

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

#submit_flush_onceObject



1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
# File 'lib/fluent/plugin/output.rb', line 1386

def submit_flush_once
  # Without locks: it is rough but enough to select "next" writer selection
  @output_flush_thread_current_position = (@output_flush_thread_current_position + 1) % @buffer_config.flush_thread_count
  state = @output_flush_threads[@output_flush_thread_current_position]
  state.mutex.synchronize {
    if state.thread && state.thread.status # "run"/"sleep"/"aborting" or false(successfully stop) or nil(killed by exception)
      state.next_clock = 0
      state.cond_var.signal
    else
      log.warn "thread is already dead"
    end
  }
  Thread.pass
end