GithubHelp home page GithubHelp logo

Comments (14)

bgreen-litl avatar bgreen-litl commented on July 21, 2024 2

@terrisgit @nirtayeb @cjw296 max_time is now supported in master - I will probably release as backoff=1.5

from backoff.

bgreen-litl avatar bgreen-litl commented on July 21, 2024 2

@tjboring thanks for the nudge. backoff==1.5.0 is now released and in pypi

Thanks all.

from backoff.

bgreen-litl avatar bgreen-litl commented on July 21, 2024 1

@terrisgit You can use max_tries to effectively set this maximum (though it might be inconvenient because you need to do the math taking into account the wait generator you're using) but @cjw296 is correct that when using full jitter max_tries is not deterministic in defining the minimum wait time.

For example if you specify max_tries=3 and get three (un?)lucky full jitter rolls, you might retry for a significantly shorter overall period than expected based on your wait generator.

I'll plan to add a max_time keyword arg.

from backoff.

terrisgit avatar terrisgit commented on July 21, 2024

Yes, a maximum is needed to avoid crazy waits like 10,000 seconds

from backoff.

bgreen-litl avatar bgreen-litl commented on July 21, 2024

@cjw296 There's a max_time implementation here #48

I'll give it some more testing before I merge is to master, but let me know if you have any feedback in the meantime.

from backoff.

terrisgit avatar terrisgit commented on July 21, 2024

Awesome! I'll give it a try.

max_tries in my use case is infinity, or until the process receives SIGINT. I guess I should submit another issue for infinity. I'm just using 1 billion for now.

from backoff.

cjw296 avatar cjw296 commented on July 21, 2024

@bgreen-litl - thanks! Unfortunately, it's been so long since I submitted this issue that I no longer have the use case to hand. Looks like others are able to test, though, so good luck!

from backoff.

bgreen-litl avatar bgreen-litl commented on July 21, 2024

@terrisgit The default is infinite retries - simply don't specify max_tries.

BTW, if you're concerned with the individual wait times (as opposed to total retry time) max_value is already supported.

Also, sounds like the SIGINT thing is a problem for async - in my experience everything shuts down cleanly in the synchronous case. I need to put some thought into and do some research on the best way to handle shutdown for async.

from backoff.

terrisgit avatar terrisgit commented on July 21, 2024

Me want max_tries=3 when I unit test, infinity when I do not. I never thought of trying None.

from backoff.

terrisgit avatar terrisgit commented on July 21, 2024

The SIGINT thing is a problem when the sleep timeout is large. Due to my ignorance of max_value, this was a bigger deal for me than it is now. The request to stop sleep for coroutines only is #47 (if you don't already have your own signal handler, you probably don't care about this issue)

from backoff.

nirtayeb avatar nirtayeb commented on July 21, 2024

I would benefit from having it as well

from backoff.

terrisgit avatar terrisgit commented on July 21, 2024

I will be trying the max_time PR soon.

from backoff.

 avatar commented on July 21, 2024

any sense of when the release will be made? just curious, as i'm looking forward to using it.

from backoff.

 avatar commented on July 21, 2024

👍

from backoff.

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.