Giter Site home page Giter Site logo

Comments (3)

alexandrepepin-boxoffice avatar alexandrepepin-boxoffice commented on July 18, 2024 1

Timeouts aren't strange, they happen rarely and they happen in combination with other unrelated redis requests. I wanted to understand how to recover from those errors. If the default expiry is 30s and configurable, that perfectly fits our needs

from distributedlock.

madelson avatar madelson commented on July 18, 2024

@alexandrepepin-boxoffice the redis lock has a default expiry of 30s (with regular renewal so long as the lock is held). See these docs.

So I would expect that if you lose connection to your Redis instance the lock would be held for no more than 30s.

You can shorten that time by fiddling with the options, but if you make it too short then you risk losing the lock spuriously due to lack on your app server (app server is too overloaded to renew the lease before it expires).

I'm also curious whether you think the timeouts themselves are strange: is this something that happens rarely and when it does other unrelated Redis requests also time out or is this something that happens every time and only when the library is trying to release?

from distributedlock.

madelson avatar madelson commented on July 18, 2024

I'm going to consider this resolved for the time being. It would be great if we had a way to ensure that the lock renewal system was not affected by thread starvation, but that seems difficult especially since StackExchange.Redis itself is async under the hood and might use the default thread pool even if we make efforts not too. So I think for now the guidance should be to set a longer expiry if you plan to exhaust the thread pool, or better yet don't exhaust the thread pool :-).

from distributedlock.

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.