diff --git a/lib/fluent/plugin/out_forward/socket_cache.rb b/lib/fluent/plugin/out_forward/socket_cache.rb index 525988e9b3..925eef0fad 100644 --- a/lib/fluent/plugin/out_forward/socket_cache.rb +++ b/lib/fluent/plugin/out_forward/socket_cache.rb @@ -50,6 +50,7 @@ def checkout_or(key) def checkin(sock) @mutex.synchronize do if (s = @inflight_sockets.delete(sock)) + s.timeout = timeout @available_sockets[s.key] << s else @log.debug("there is no socket #{sock}") @@ -122,6 +123,7 @@ def pick_socket(key) t = Time.now if (s = @available_sockets[key].find { |sock| !expired_socket?(sock, time: t) }) @inflight_sockets[s.sock] = @available_sockets[key].delete(s) + s.timeout = timeout s else nil