engine: improve logging on failed and successful retries (#1318)
engine: improve logging on failed and successful retries (#1318)

This patch improves overall engine logging on retries. Now we get
a clear notion of chunk names and it status.

== Failed retry, per retry limit==

  Fluent Bit v1.3.7
  Copyright (C) Treasure Data

  [2020/02/06 15:45:49] [ info] [storage] initializing...
  [2020/02/06 15:45:49] [ info] [storage] in-memory
  [2020/02/06 15:45:49] [ info] [storage] normal synchronization mode, checksum disabled, max_chunks_up=128
  [2020/02/06 15:45:49] [ info] [engine] started (pid=31492)
  [2020/02/06 15:45:49] [ info] [sp] stream processor started
  [2020/02/06 15:45:50] [error] [io] TCP connection failed: 127.0.0.1:24224 (Connection refused)
  [2020/02/06 15:45:50] [error] [out_fw] no upstream connections available
  [2020/02/06 15:45:50] [ warn] [engine] failed to flush chunk '31492-1581025550.122322.flb', retry in 11 seconds: task_id=0, input=localdata > output=remote
  [2020/02/06 15:46:00] [error] [io] TCP connection failed: 127.0.0.1:24224 (Connection refused)
  [2020/02/06 15:46:00] [error] [out_fw] no upstream connections available
  [2020/02/06 15:46:00] [ warn] [engine] chunk '31492-1581025550.122322.flb' cannot be retried: task_id=0, input=localdata > output=remote

== Succeed after one failed retry ==

  Fluent Bit v1.3.7
  Copyright (C) Treasure Data

  [2020/02/06 15:48:16] [ info] [storage] initializing...
  [2020/02/06 15:48:16] [ info] [storage] in-memory
  [2020/02/06 15:48:16] [ info] [storage] normal synchronization mode, checksum disabled, max_chunks_up=128
  [2020/02/06 15:48:16] [ info] [engine] started (pid=32060)
  [2020/02/06 15:48:16] [ info] [sp] stream processor started
  [2020/02/06 15:48:17] [error] [io] TCP connection failed: 127.0.0.1:24224 (Connection refused)
  [2020/02/06 15:48:17] [error] [out_fw] no upstream connections available
  [2020/02/06 15:48:17] [ warn] [engine] failed to flush chunk '32060-1581025697.110511.flb', retry in 11 seconds: task_id=0, input=localdata > output=remote
  [2020/02/06 15:48:27] [ info] [engine] flush chunk '32060-1581025697.110511.flb' succeeded at retry 1: task_id=1, input=localdata > output=remote

Signed-off-by: Eduardo Silva <81f705dc2ce1a61a2621e0e4b442a9474e1d0c70@treasure-data.com>

nokute78/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit,nokute78/fluent-bit,nokute78/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,fluent/fluent-bit,fluent/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit,nokute78/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,fluent/fluent-bit,nokute78/fluent-bit,fluent/fluent-bit,fluent/fluent-bit,fluent/fluent-bit