Skip to content

Commit e20ab40

Browse files
committed
Mark both client and server as not worker safe
This is due to IO#select not being threadsafe in JRuby Fixes #13
1 parent 6dfdafd commit e20ab40

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

CHANGELOG.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 3.2.0
2+
- Declare plugin as not worker safe for both server and client mode. (IO#select is not threadsafe)
3+
14
## 3.1.0
25
- breaking,config: Remove deprecated config `message_format`
36

@@ -14,7 +17,6 @@
1417
- New dependency requirements for logstash-core for the 5.0 release
1518

1619
## 2.0.0
17-
- Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
20+
- Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
1821
instead of using Thread.raise on the plugins' threads. Ref: https://github.com/elastic/logstash/pull/3895
1922
- Dependency on logstash-core update to 2.0
20-

lib/logstash/outputs/tcp.rb

+5-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class LogStash::Outputs::Tcp < LogStash::Outputs::Base
3030
# `client` connects to a server.
3131
config :mode, :validate => ["server", "client"], :default => "client"
3232

33+
declare_workers_not_supported!
34+
3335
class Client
3436
public
3537
def initialize(socket, logger)
@@ -61,9 +63,10 @@ def write(msg)
6163
def register
6264
require "socket"
6365
require "stud/try"
64-
if server?
65-
workers_not_supported
6666

67+
workers_not_supported
68+
69+
if server?
6770
@logger.info("Starting tcp output listener", :address => "#{@host}:#{@port}")
6871
@server_socket = TCPServer.new(@host, @port)
6972
@client_threads = []

logstash-output-tcp.gemspec

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Gem::Specification.new do |s|
22

33
s.name = 'logstash-output-tcp'
4-
s.version = '3.1.0'
4+
s.version = '3.2.0'
55
s.licenses = ['Apache License (2.0)']
66
s.summary = "Write events over a TCP socket."
77
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"
@@ -27,4 +27,3 @@ Gem::Specification.new do |s|
2727

2828
s.add_development_dependency 'logstash-devutils'
2929
end
30-

0 commit comments

Comments
 (0)