Skip to content
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

Many Errors/Warnings around the Use of Thread.exclusive being Logged when Used with LS 6.x #19

Open
original-brownbear opened this issue Oct 4, 2017 · 5 comments
Labels

Comments

@original-brownbear
Copy link

Running this plugin with LS 6.x results in the following error being logged for seemingly every event:

Thread.exclusive is deprecated, use Mutex
/Users/brownbear/src/logstash/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.9/lib/onstomp.rb:121:in `next_serial'
/Users/brownbear/src/logstash/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.9/lib/onstomp/components/scopes/transaction_scope.rb:189:in `next_transaction_id'
/Users/brownbear/src/logstash/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.9/lib/onstomp/components/scopes/transaction_scope.rb:47:in `begin_with_transaction'
/Users/brownbear/src/logstash/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.9/lib/onstomp/components/scopes/transaction_scope.rb:160:in `perform'
/Users/brownbear/src/logstash/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.9/lib/onstomp/components/scopes.rb:24:in `block in transaction'
/Users/brownbear/src/logstash/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.9/lib/onstomp/components/scopes.rb:23:in `tap'
/Users/brownbear/src/logstash/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.9/lib/onstomp/components/scopes.rb:23:in `transaction'
/Users/brownbear/src/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-stomp-3.0.7/lib/logstash/outputs/stomp.rb:77:in `multi_receive'
/Users/brownbear/src/logstash/logstash-core/lib/logstash/output_delegator_strategies/legacy.rb:22:in `multi_receive'
/Users/brownbear/src/logstash/logstash-core/lib/logstash/output_delegator.rb:49:in `multi_receive'
/Users/brownbear/src/logstash/logstash-core/lib/logstash/pipeline.rb:536:in `block in output_batch'
/Users/brownbear/src/logstash/logstash-core/lib/logstash/pipeline.rb:535:in `each'
/Users/brownbear/src/logstash/logstash-core/lib/logstash/pipeline.rb:535:in `output_batch'
/Users/brownbear/src/logstash/logstash-core/lib/logstash/pipeline.rb:481:in `worker_loop'
/Users/brownbear/src/logstash/logstash-core/lib/logstash/pipeline.rb:437:in `block in start_workers'
Thread.exclusive is deprecated, use Mutex

Looks like JRuby 9k changed/deprecated something that we should adjust for :)

@original-brownbear original-brownbear changed the title Many Errors being Logged when used with LS 6.x Many Errors/Warnings around the Use of Thread.exclusive being Logged when Used with LS 6.x Oct 4, 2017
@robin13
Copy link

robin13 commented Oct 24, 2017

This diff based on (here) to onstomp.rb seems to fix:

-bash-4.2$ diff -Naur onstomp.rb_SAVE onstomp.rb
--- onstomp.rb_SAVE    2017-10-24 09:53:56.365580722 +0200
+++ onstomp.rb 2017-10-24 09:54:59.629782201 +0200
@@ -87,6 +87,7 @@
  class StopReceiver < StandardError; end
 
  class << self
+   SEMAPHORE = Mutex.new
    # Creates a new connection and immediately connects it to the broker.
    # @see #initialize
    def connect(uri, options={})
@@ -118,7 +119,8 @@
    # merely initializes an instance variable to 0 if it has not been set,
    # then increments this value and returns its string representation.
    def next_serial(prefix=nil)
-     Thread.exclusive do
+     # Thread.exclusive do
+     SEMAPHORE.synchronize do
        @next_serial_sequence ||= 0
        @next_serial_sequence += 1
        @next_serial_sequence.to_s

@smartkathycat
Copy link

smartkathycat commented Feb 22, 2019

One user ran into the same issue here. Is this bug been worked on a fix?

Error message:

[2019-02-22T10:11:56,725][INFO ][logstash.agent           ] Successfully started Logstash API endpoint {:port=>9600}
Thread.exclusive is deprecated, use Mutex
/CBGM/logstash-6.3.1/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.10/lib/onstomp.rb:121:in `next_serial'
/CBGM/logstash-6.3.1/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.10/lib/onstomp/components/scopes/transaction_scope.rb:189:in `next_transaction_id'
/CBGM/logstash-6.3.1/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.10/lib/onstomp/components/scopes/transaction_scope.rb:47:in `begin_with_transaction'
/CBGM/logstash-6.3.1/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.10/lib/onstomp/components/scopes/transaction_scope.rb:160:in `perform'
/CBGM/logstash-6.3.1/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.10/lib/onstomp/components/scopes.rb:24:in `block in transaction'
/CBGM/logstash-6.3.1/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.10/lib/onstomp/components/scopes.rb:23:in `tap'
/CBGM/logstash-6.3.1/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.10/lib/onstomp/components/scopes.rb:23:in `transaction'
/CBGM/logstash-6.3.1/vendor/bundle/jruby/2.3.0/gems/logstash-output-stomp-3.0.9/lib/logstash/outputs/stomp.rb:77:in `multi_receive'
/CBGM/logstash-6.3.1/logstash-core/lib/logstash/pipeline.rb:475:in `multi_receive'
/CBGM/logstash-6.3.1/logstash-core/lib/logstash/pipeline.rb:475:in `block in output_batch'
/CBGM/logstash-6.3.1/logstash-core/lib/logstash/pipeline.rb:474:in `each'
/CBGM/logstash-6.3.1/logstash-core/lib/logstash/pipeline.rb:474:in `output_batch'
/CBGM/logstash-6.3.1/logstash-core/lib/logstash/pipeline.rb:426:in `worker_loop'
/CBGM/logstash-6.3.1/logstash-core/lib/logstash/pipeline.rb:384:in `block in start_workers'
Thread.exclusive is deprecated, use Mutex
/CBGM/logstash-6.3.1/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.10/lib/onstomp.rb:121:in `next_serial'
/CBGM/logstash-6.3.1/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.10/lib/onstomp/components/scopes/transaction_scope.rb:189:in `next_transaction_id'
/CBGM/logstash-6.3.1/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.10/lib/onstomp/components/scopes/transaction_scope.rb:47:in `begin_with_transaction'
/CBGM/logstash-6.3.1/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.10/lib/onstomp/components/scopes/transaction_scope.rb:160:in `perform'
/CBGM/logstash-6.3.1/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.10/lib/onstomp/components/scopes.rb:24:in `block in transaction'
/CBGM/logstash-6.3.1/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.10/lib/onstomp/components/scopes.rb:23:in `tap'
/CBGM/logstash-6.3.1/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.10/lib/onstomp/components/scopes.rb:23:in `transaction'
/CBGM/logstash-6.3.1/vendor/bundle/jruby/2.3.0/gems/logstash-output-stomp-3.0.9/lib/logstash/outputs/stomp.rb:77:in `multi_receive'
/CBGM/logstash-6.3.1/logstash-core/lib/logstash/pipeline.rb:475:in `multi_receive'
/CBGM/logstash-6.3.1/logstash-core/lib/logstash/pipeline.rb:475:in `block in output_batch'
/CBGM/logstash-6.3.1/logstash-core/lib/logstash/pipeline.rb:474:in `each'
/CBGM/logstash-6.3.1/logstash-core/lib/logstash/pipeline.rb:474:in `output_batch'
/CBGM/logstash-6.3.1/logstash-core/lib/logstash/pipeline.rb:426:in `worker_loop'
/CBGM/logstash-6.3.1/logstash-core/lib/logstash/pipeline.rb:384:in `block in start_workers'
Thread.exclusive is deprecated, use Mutex
/CBGM/logstash-6.3.1/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.10/lib/onstomp.rb:121:in `next_serial'
/CBGM/logstash-6.3.1/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.10/lib/onstomp/components/scopes/transaction_scope.rb:189:in `next_transaction_id'
/CBGM/logstash-6.3.1/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.10/lib/onstomp/components/scopes/transaction_scope.rb:47:in `begin_with_transaction'
/CBGM/logstash-6.3.1/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.10/lib/onstomp/components/scopes/transaction_scope.rb:160:in `perform'
/CBGM/logstash-6.3.1/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.10/lib/onstomp/components/scopes.rb:24:in `block in transaction'
/CBGM/logstash-6.3.1/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.10/lib/onstomp/components/scopes.rb:23:in `tap'
/CBGM/logstash-6.3.1/vendor/bundle/jruby/2.3.0/gems/onstomp-1.0.10/lib/onstomp/components/scopes.rb:23:in `transaction'
/CBGM/logstash-6.3.1/vendor/bundle/jruby/2.3.0/gems/logstash-output-stomp-3.0.9/lib/logstash/outputs/stomp.rb:77:in `multi_receive'

@Kolano
Copy link

Kolano commented Jul 2, 2019

I'm now getting this when starting up Logstash v7.2

Jul  1 23:53:32 pass logstash[12910]: Thread.exclusive is deprecated, use Thread::Mutex
Jul  1 23:53:35 pass logstash[12910]: Sending Logstash logs to /var/log/logstash which is now configured via log4j2.properties
Jul  1 23:53:35 pass logstash[12910]: [2019-07-01T23:53:35,645][INFO ][logstash.runner          ] Starting Logstash {"logstash.version"=>"7.2.0"}

@alilland
Copy link

getting the error in v7.3

.\bin\logstash.bat : Thread.exclusive is deprecated, use Thread::Mutex
At line:1 char:1
+ .\bin\logstash.bat
+ ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Thread.exclusiv...e Thread::Mutex:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

@kzgrzendek
Copy link

Also have it in 7.4.2 :

Thread.exclusive is deprecated, use Thread::Mutex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants