Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/fluent/plugin/out_keep_forward.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down