diff --git a/lib/fluent/plugin/out_keep_forward.rb b/lib/fluent/plugin/out_keep_forward.rb index 9792b48..1cadad9 100644 --- a/lib/fluent/plugin/out_keep_forward.rb +++ b/lib/fluent/plugin/out_keep_forward.rb @@ -200,6 +200,9 @@ def reconnect(node) end def sock_write(sock, tag, chunk) + oldsync = sock.sync + sock.sync = false + # beginArray(2) sock.write FORWARD_HEADER @@ -221,6 +224,10 @@ def sock_write(sock, tag, chunk) # writeRawBody(packed_es) chunk.write_to(sock) + + ensure + sock.sync = oldsync + sock.flush # for immediate call of write(2) end # watcher thread callback