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

Potential incompatibility with ruby memcached client #4348

Open
ashotland opened this issue Dec 21, 2024 · 3 comments
Open

Potential incompatibility with ruby memcached client #4348

ashotland opened this issue Dec 21, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@ashotland
Copy link
Contributor

Using dali client set commands times out

To Reproduce
Steps to reproduce the behavior:
install ruby and dali
sudo apt update
sudo apt install ruby-full
sudo gem install dalli

create test.rb with the following content

require 'dalli'

begin
  # Create Memcached client with minimal configuration
  memcached = Dalli::Client.new('localhost:11211', {
    socket_timeout: 30,  # Increased timeout
    compress: false,     # Disable compression
    serializer: nil      # Disable serialization to match telnet behavior
  })

  puts "Testing connection..."

  # Try the same operation that worked in telnet
  result = memcached.set('my_key', 'hello', 900)
  puts "Set result: #{result}"

  value = memcached.get('my_key')
  puts "Retrieved value: #{value}"

rescue => e
  puts "Error: #{e.class} - #{e.message}"
  puts e.backtrace
end

Run dragonfly
docker run --pull always --network=host --ulimit memlock=-1 docker.dragonflydb.io/dragonflydb/dragonfly:latest --memcached_port 11211

Run ruby script
ruby test.rb

Expected behavior
Expect script to print response but it times out instead

The following script succeeds

@ashotland ashotland added the bug Something isn't working label Dec 21, 2024
@romange
Copy link
Collaborator

romange commented Dec 21, 2024

Probably same like #3071

we do not support memcache binary protocol

@ashotland
Copy link
Contributor Author

Trying with protocol: 'meta' only options are binary or meta

require 'dalli'

begin
  # Create Memcached client with minimal configuration
  memcached = Dalli::Client.new('localhost:11211', {
    socket_timeout: 30,  # Increased timeout
    compress: false,     # Disable compression
    protocol: 'meta'
  })

  puts "Testing connection..."

  # Try the same operation that worked in telnet
  result = memcached.set('my_key', 'hello', 900)
  puts "Set result: #{result}"

  value = memcached.get('my_key')
  puts "Retrieved value: #{value}"

rescue => e
  puts "Error: #{e.class} - #{e.message}"
  puts e.backtrace
end

getting

ruby test.rb 
Testing connection...
Error: Dalli::DalliError - Response error: ERROR
/var/lib/gems/3.0.0/gems/dalli-3.2.8/lib/dalli/protocol/meta/response_processor.rb:170:in `error_on_unexpected!'
/var/lib/gems/3.0.0/gems/dalli-3.2.8/lib/dalli/protocol/meta/response_processor.rb:54:in `meta_set_with_cas'
/var/lib/gems/3.0.0/gems/dalli-3.2.8/lib/dalli/protocol/meta.rb:66:in `set'
/var/lib/gems/3.0.0/gems/dalli-3.2.8/lib/dalli/protocol/base.rb:36:in `request'
/var/lib/gems/3.0.0/gems/dalli-3.2.8/lib/dalli/options.rb:18:in `block in request'
/var/lib/gems/3.0.0/gems/dalli-3.2.8/lib/dalli/options.rb:17:in `synchronize'
/var/lib/gems/3.0.0/gems/dalli-3.2.8/lib/dalli/options.rb:17:in `request'
/var/lib/gems/3.0.0/gems/dalli-3.2.8/lib/dalli/client.rb:426:in `perform'
/var/lib/gems/3.0.0/gems/dalli-3.2.8/lib/dalli/client.rb:208:in `set_cas'
/var/lib/gems/3.0.0/gems/dalli-3.2.8/lib/dalli/client.rb:201:in `set'
test.rb:14:in `<main>'

@romange
Copy link
Collaborator

romange commented Dec 22, 2024

yeah, we do not support both meta nor binary.

@romange romange added enhancement New feature or request and removed bug Something isn't working labels Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants