fluent/fluentd — pull request #422 by itiut (2014-08-25 03:12:42+00:00)
Title: [WIP guaranteed delivery from ForwardOutput to ForwardInput

This is a implementation of #408.

Protocols between ForwardOutput and ForwardInput are extended, adding `option` object to the end of the array, which is used to identify which chunks are written into the buffer.

Additional behaviors of ForwardOutput and ForwardInput are as follows:

#### ForwardOutput
ForwardOutput sends data including `option` object which has object id of the chunk with a value of `seq` key. After sending data, ForwardOutput waits for a response from InputForward in a certain time.

* If there is a response:
* and if `ack` value of the response is same as `seq` value of sent data, it succeeded.
* but if `ack` value and `seq` value are different, ForwardOutput sends the chunk again.

* If there is no response, ForwardOutput regards the target node as unavailable but does not send the chunk again because of compatibility.

#### InputForward
InputForward checks if received data includes `option` object. If it does, InputForward responds to OutputForward after the chunk is written into the buffer (Engine.emit). The response has the `seq` value of the received data as a value of `ack` key, and is serialized in the same way as received data.