Giter VIP home page Giter VIP logo

Comments (4)

spion avatar spion commented on July 30, 2024

Could you elaborate more on your use case? Would this apply only the first time the master process is run?

In some of the cases the problem can be fixed without rerunning the master e.g. failing to parse a configuration file with a typo or to load a missing module. A large enough backoff value will quickly cause the respawns to be far enough between.

Looking at the code I noticed that opt.backoff is by default undefined, which will cause all restart timers to fire quickly all the time (every second by default). Perhaps this will be solved by providing default backoff and restart values that are saner, like e.g. 60s? That way instead of a resource-intensive endless loop you would get a few fast retries, but recluster will quickly back off to occasional retries every minute, which might be an acceptable option.

from recluster.

humphd avatar humphd commented on July 30, 2024

I have a cluster master that is spinning up server forks. If these forks never get to ready, instead of respawning, I'd like the option to kill the server. In essence, I want an option to say, "only respawn if we ever got to ready." I can see how this is not necessarily something you'd want in the default case. However, I'd argue that if a server never gets to ready, it's unlikely to get to ready ever; whereas a crashed server (one that did get to ready, ran, and hit some kind of error) is one that should be restarted.

Does that make sense? It isn't about the time period between respawns so much as having a threshold beyond which we respawn, but before which we shut down.

from recluster.

spion avatar spion commented on July 30, 2024

I think I understand now. If an error such as that occurs, I usually want to revert to an earlier version of the main program asap and let the automatic restart pick it up - and only in the special case where I don't want that (because for example env variables need to change) I'd provide a way to call .terminate() manually (e.g. via SIGHUP). then start the master again

However, your approach is an equally valid alternative. I'll try to find some time this weekend to give it a try. I'd also welcome a pull request, if you have the time for it :)

from recluster.

spion avatar spion commented on July 30, 2024

Closing with wontfix - the recommended solution is to take advantage of the backoff option to avoid wasting resources and kill the process externally if its not possible to solve the problem by swapping the code (e.g. because the problem is missing environment variables)

from recluster.

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.