Autopkgtest regression trigerred by Ruby 2.7
Bug #1866884 reported by
Lucas Kanashiro
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/
autopkgtest log on amd64 as an example:
To post a comment you must log in.
"lib/em- hiredis/ client. rb":
def eval_script(lua, lua_sha, keys, args) rrable. new missing( :evalsha, lua_sha, keys.size, *keys, *args).callback(
&df.method( :succeed) of?(RedisError) && e.redis_ error.message. start_with? ("NOSCRIPT" )
self. eval(lua, keys.size, *keys, *args)
.callback( &df.method( :succeed) ).errback( &df.method( :fail))
df.fail( e)
df = EM::DefaultDefe
method_
).errback { |e|
if e.kind_
else
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 = 32d8d2000576c02 c167c899979858c 886d4524aa 6d49314bbcec2cc c76e", 2]
keys = ["test-lock"]
args= ["b978de50e3612