Git Product home page Git Product logo

Comments (7)

97jaz avatar 97jaz commented on May 26, 2024

Oh, by the way, in case you were wondering: we're not using a wait_timeout of less than a millisecond. It's that on a subsequent iteration of the while loop, diff is sometimes that small.

from sidekiq.

mperham avatar mperham commented on May 26, 2024

Ok, I see:

  1. A limiter call loops until the diff value gets down to <0.001.
  2. Sidekiq issues a BLMOVE call with timeout <0.001.
  3. Because Redis treats that as a zero timeout, BLMOVE times out on the client-side after 1 second.

Thank you for figuring that out!

from sidekiq.

mperham avatar mperham commented on May 26, 2024

Redis 7.2.3 does not display this behavior. It pauses:

$ redis-cli
127.0.0.1:6379> BLMOVE foo bar LEFT RIGHT 0.1
(nil)
127.0.0.1:6379> BLMOVE foo bar LEFT RIGHT 0.01
(nil)
127.0.0.1:6379> BLMOVE foo bar LEFT RIGHT 0.001
(nil)
127.0.0.1:6379> BLMOVE foo bar LEFT RIGHT 0.0001
(nil)
127.0.0.1:6379> BLMOVE foo bar LEFT RIGHT 0.000001
(nil)
127.0.0.1:6379> BLMOVE foo bar LEFT RIGHT 0

Whereas 0 actually blocks.

from sidekiq.

97jaz avatar 97jaz commented on May 26, 2024

Interesting. I just verified the behavior I described above (on Redis 7.0) using redis-cli directly (just in case there was an issue in redis-client). It's blocking with a timeout of 0.001.

So this is either Redis version-dependent or possibly platform-dependent (this redis server is running on linux).

from sidekiq.

97jaz avatar 97jaz commented on May 26, 2024

Oh, also: the exact version I'm looking at is 7.0.7. A colleague just tried this out on his locally-installed redis (7.0.11 on macos). A timeout of 0.001 did not block.

from sidekiq.

97jaz avatar 97jaz commented on May 26, 2024

Okay, found it: redis/redis@574a49b

In fact, this seems to have been fixed in the very next version (7.0.8). So that's some bad luck for us.

from sidekiq.

mperham avatar mperham commented on May 26, 2024

Thanks for all the research. It appears to be a Redis bug which has been fixed so I'll close with no action.

from sidekiq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.