From 8bb639bfeeb09d44bb043b46b212f1d81aa67090 Mon Sep 17 00:00:00 2001 From: Kenji Okimoto Date: Wed, 6 Sep 2017 13:54:02 +0900 Subject: [PATCH] Sleep if readable sockets are empty --- lib/fluent/plugin/out_forward.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/fluent/plugin/out_forward.rb b/lib/fluent/plugin/out_forward.rb index b99cd5843b..4110af2634 100644 --- a/lib/fluent/plugin/out_forward.rb +++ b/lib/fluent/plugin/out_forward.rb @@ -493,7 +493,10 @@ def ack_reader end readable_sockets, _, _ = IO.select(sockets, nil, nil, select_interval) - next unless readable_sockets + unless readable_sockets + sleep 0.01 + next + end readable_sockets.each do |sock| chunk_id = read_ack_from_sock(sock, unpacker)