Closed ccleung closed 5 years ago
Let me see if I can fix this real fast for you @ccleung. Which redis version are you on?
A crap, you must be on redis < 3.2. It doesn't support HSET
without replicate_commands. I completely forgot about that.
thanks @mhenrixon - added some more info in the "additional context", we are on redis redis_version:3.2.11
Thanks for the additional info @ccleung. Weird... If I recall correctly redis.replicate_commands() is only available for the redis version you are on and later. The least supported redis version for the gem can't use it yet. I'll pass a timestamp into the script instead.
The PR you linked to actually fixes the problem for later redis versions I suppose. If you know how I could test against different redis versions on Travis CI that would be amazing!
thanks for the fix! did a quick google search myself but i haven't been able to find out how to run travis ci against multiple redis versions
Released in 6.0.12
Describe the bug
unique: :until_executed
=>lock: :until_executed
Expected behavior
Current behavior
vendor/bundle/ruby/2.5.0/gems/sidekiq-unique-jobs-6.0.11/lib/sidekiq_unique_jobs/scripts.rb:72:in handle_error': Problem compiling convert_legacy_lock. Message: ERR Error running script (call to f_27db703fc092c8f53319e798cace06a2d7f96fe6): @user_script:19: @user_script: 19: Write commands not allowed after non deterministic commands. Call redis.replicate_commands() at the start of your script in order to switch to single commands replication mode. (SidekiqUniqueJobs::ScriptError)
,see stacktrace:
Example Worker class configuration
Additional context
redis.replicate_commands()
to the top of the scripts