You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We call aerospike in sidekiq workers which requires to have all classes thread safe.
Calling Aerospike::Key.new(arguments)
raises Digest::Base cannot be directly inherited in Ruby
1 gems/aerospike-2.3.0/lib/aerospike/key.rb" line 31 in new
2 gems/aerospike-2.3.0/lib/aerospike/key.rb" line 31 in block in <class:Key>
3 gems/aerospike-2.3.0/lib/aerospike/utils/pool.rb" line 46 in rescue in poll
4 gems/aerospike-2.3.0/lib/aerospike/utils/pool.rb" line 43 in poll
5 gems/aerospike-2.3.0/lib/aerospike/key.rb" line 117 in compute_digest
6 gems/aerospike-2.3.0/lib/aerospike/key.rb" line 61 in initialize
Interesting! I found similar issues raised in various other projects, e.g. for the AWS SDK or Chef. But it's not yet clear to me what the right solution is:
Replace usage of Digest with OpenSSL::Digest - Are there any downsides to using OpenSSL::Digest? Need to clarify why we are using Digest on MRI in the first place.
Use Digest(:RMD160) instead of Digest::RMD160.new - But looks like Digest() was only made thread-safe in Ruby 2.2, so might not be solving the issue in older versions of Ruby.
We call aerospike in sidekiq workers which requires to have all classes thread safe.
Calling
Aerospike::Key.new(arguments)
raises
Digest::Base cannot be directly inherited in Ruby
From ruby docs we can call Digest classes in thread safe manner:
https://docs.ruby-lang.org/en/2.2.0/Object.html#method-i-Digest
I think it should be done here:
https://github.com/aerospike/aerospike-client-ruby/blob/master/lib/aerospike/key.rb#L31
The text was updated successfully, but these errors were encountered: