Autopkgtest regression trigerred by Ruby 2.7

Bug #1866884 reported by Lucas Kanashiro
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ruby-em-hiredis (Ubuntu)
Fix Released
Undecided
Lucas Kanashiro

Bug Description

ruby-em-hiredis version 0.3.1-1 has a regression in all architectures triggered by ruby-defaults/1:2.7~0.

autopkgtest log on amd64 as an example:

https://objectstorage.prodstack4-5.canonical.com/v1/AUTH_77e2ada1e7a84929a74ba3b87153c0ac/autopkgtest-focal/focal/amd64/r/ruby-em-hiredis/20200305_182652_94b8d@/log.gz

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

"lib/em-hiredis/client.rb":

    def eval_script(lua, lua_sha, keys, args)
      df = EM::DefaultDeferrable.new
      method_missing(:evalsha, lua_sha, keys.size, *keys, *args).callback(
        &df.method(:succeed)
      ).errback { |e|
        if e.kind_of?(RedisError) && e.redis_error.message.start_with?("NOSCRIPT")
          self.eval(lua, keys.size, *keys, *args)
            .callback(&df.method(:succeed)).errback(&df.method(:fail))
        else
          df.fail(e)
        end
      }
      df
    end

whenever evalsha method is not available, self.eval(lua, keys.size, *keys, *args) complains about the number of variables being given to self.eval(). It is likely that the method definition (self) has changed among ruby versions. The arguments seem fine, example:

lua =

-- Set key to token with expiry of timeout, if:
-- - It doesn't exist
-- - It exists and already has value of token (further set extends timeout)
-- Used to implement a re-entrant lock.
local key = KEYS[1]
local token = ARGV[1]
local timeout = ARGV[2]

local value = redis.call('get', key)

if value == token or not value then
    -- Great, either we hold the lock or it's free for us to take
    return redis.call('setex', key, timeout, token)
else
    -- Someone else has it
    return false
end

lua_sha = 32d8d2000576c02c167c899979858c886d4524aa
keys = ["test-lock"]
args= ["b978de50e36126d49314bbcec2ccc76e", 2]

Changed in ruby-em-hiredis (Ubuntu):
status: New → Confirmed
assignee: nobody → Lucas Kanashiro (lucaskanashiro)
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Upstream is dead and only ruby-em-synchrony depends on it, so I decided to make ruby-em-synchrony not depend on it anymore and request its removal from Focal:

https://bugs.launchpad.net/ubuntu/+source/ruby-em-hiredis/+bug/1869434

The same was made in Debian.

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

ruby-em-hiredis was already removed from Focal, check the bug url linked above.

Changed in ruby-em-hiredis (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.