-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Claims to be threadsafe, is not #13
Comments
This is due to IO#select not being threadsafe in JRuby Fixes logstash-plugins#13
@jsvd HAH! |
apparently all output workers for the tcp output will share the same codec, which means they all run the same instance of the Responsible code https://github.com/logstash-plugins/logstash-output-tcp/blob/master/lib/logstash/outputs/tcp.rb#L97-L101: else
client_socket = nil
puts "#{self.class} plugin id #{self.object_id} has codec #{@codec.object_id}"
@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
Also, each output worker should be getting a codec instance for itself. I'm still investigating why that happens. |
@jsvd excellent find WRT codecs! I never even considered that. The instances should definitely be separate, I can't believe we never saw a bug there before. |
This is due to IO#select not being threadsafe in JRuby Fixes logstash-plugins#13
This plugin claims to be safe for multiple output workers, but in fact is not due to
IO#select
on jruby not being threadsafe. We should setdeclare_workers_not_supported!
to fix this.The concurrency error Jruby will raise is below.
The text was updated successfully, but these errors were encountered: