diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fb254e..9b4633f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 6.0.1 + - Use sync socket write to ensure that full message is written to socket. + ## 6.0.0 - Removed obsolete field `message_format` diff --git a/lib/logstash/outputs/tcp.rb b/lib/logstash/outputs/tcp.rb index 63d7bea..b0bb8b6 100644 --- a/lib/logstash/outputs/tcp.rb +++ b/lib/logstash/outputs/tcp.rb @@ -151,14 +151,7 @@ def register @codec.on_event do |event, payload| begin client_socket = connect unless client_socket - r,w,e = IO.select([client_socket], [client_socket], [client_socket], nil) - # don't expect any reads, but a readable socket might - # mean the remote end closed, so read it and throw it away. - # we'll get an EOFError if it happens. - client_socket.sysread(16384) if r.any? - - # Now send the payload - client_socket.syswrite(payload) if w.any? + client_socket.syswrite(payload) rescue => e @logger.warn("tcp output exception", :host => @host, :port => @port, :exception => e, :backtrace => e.backtrace) diff --git a/logstash-output-tcp.gemspec b/logstash-output-tcp.gemspec index 25ac640..73a3df4 100644 --- a/logstash-output-tcp.gemspec +++ b/logstash-output-tcp.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.name = 'logstash-output-tcp' - s.version = '6.0.0' + s.version = '6.0.1' s.licenses = ['Apache License (2.0)'] s.summary = "Writes events over a TCP socket" s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"