Skip to content

Increase redlock redis timeout, backport CI changes - #14

Merged
dsander merged 5 commits into
0.2from
feature/increase-redlock-redis-timeout
Oct 8, 2026
Merged

dsander merged 5 commits into
0.2from
feature/increase-redlock-redis-timeout

Conversation

@dsander

@dsander dsander commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

The first two commits are cherry picked from master, done in the Sidekiq 8 update, it adds CI and fixes the tests on Ruby 3.4. This targets 0.2 (for Sidekiq 6)


Increase redlock redis timeout to 1 second

Their default is 0.1 seconds, since we started deploying servers in
different regions this started to become a problem. Sidekiq does not
recommend having a high latency but it still works, we on the other hand
failed as soon as the ping between the two servers got larger than
100ms.

https://github.com/leandromoreira/redlock-rb/tree/1.3.2#redlock-configuration

This makes the tests work on ruby 3.4. No runtime gems have been updated
yet. Removed usage of internal Sidekiq API in the test to hopefully make
updates simpler.
`.lock` yields the lock/lock information, if it is false the lock
was not acquired.

Moving the mocks removes the reliance on internal API of redlock,
updating it should surface breakage if they changed the API or
behaviour.
Their default is 0.1 seconds, since we started deploying servers in
different regions this started to become a problem. Sidekiq does not
recommend having a high latency but it still works, we on the other hand
failed as soon as the ping between the two servers got larger than
100ms.

https://github.com/leandromoreira/redlock-rb/tree/1.3.2#redlock-configuration
@dsander
dsander requested review from bigzed and misku October 8, 2026 08:56
Comment thread lib/sidekiq/repeat/configuration.rb Resolved
@dsander
dsander force-pushed the feature/increase-redlock-redis-timeout branch from 26d7f6b to f2af7c1 Compare October 8, 2026 12:46
Before we fixed the call we never actually validated that we got the
lock from redlock, our `reschedule_all` call should be able to finish
within 500ms, but if the ping to redis is larger we have less and less
time, potentially blocking the startup of others by up to 5 seconds
should not be an issue.
@dsander
dsander force-pushed the feature/increase-redlock-redis-timeout branch from f2af7c1 to 0587c7a Compare October 8, 2026 12:47
@dsander
dsander requested a review from misku October 8, 2026 12:55

@misku misku left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I think this is the correct way of approving a PR on github 👴

@dsander

dsander commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

Thank you! I think this is the correct way of approving a PR on github 👴

Thanks! :dawey:

/merge

@dsander
dsander merged commit 6e6e0e6 into 0.2 Oct 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants