Coder Social home page Coder Social logo

Comments (5)

jschaf avatar jschaf commented on July 4, 2024

I have the option of keeping the old process alive and forwarding signals mostly working. I've hit one snag, tableflip.Upgrade returns the error parent hasn't exited from the new process.

I've verified the the old process calls tableflip.Stop(). Is there additional state that's only cleaned up if the parent process exits?

Edit Looks like neverCloseThisFile might prevent the parent upgrader from exiting.

// Save file in exitFd, so that it's only closed when the process
// exits. This signals to the new process that the old process
// has exited.
u.exitFd <- neverCloseThisFile{file}

from tableflip.

lmb avatar lmb commented on July 4, 2024

Sorry for the late reply, I'm glad you find tableflip useful!

You're pretty much spot on, this is a feature I'd like as well. The problem with keeping the old parent around is that it violates one of the invariants that I set for this package: after a successful upgrade, no old code is left running.

Think of it another way, what would happen if you implement your idea and then do multiple upgrades? Would you keep growing the number of processes? I've not found good answers to this, so I just resorted to using a systemd-run shim for testing upgrades.

from tableflip.

jschaf avatar jschaf commented on July 4, 2024

Think of it another way, what would happen if you implement your idea and then do multiple upgrades?

I think you can do it if you add another opt-in invariant: after receiving a single upgrade the old code must exit. That's a bad invariant for production. If the new server fails to start, now you have no servers, so maybe not worth adding.

For a simpler approach, maybe I could orchestrate with a wrapper binary, similar to the systemd shim? And even simpler still, I could skip tableflip and kill the server then restart it without the graceful handoff.

from tableflip.

lmb avatar lmb commented on July 4, 2024

I think you can do it if you add another opt-in invariant: after receiving a single upgrade the old code must exit.

So you'd be able to trigger one upgrade, but triggering number 2 would have the same behaviour as currently? I think that's pretty difficult to explain to users, so I'd rather not add it.

For a simpler approach, maybe I could orchestrate with a wrapper binary, similar to the systemd shim?

Yes, if you want to avoid systemd that's doable.

from tableflip.

jschaf avatar jschaf commented on July 4, 2024

Thanks, I don't see a good way to add this functionality to the library so I'll close this.

from tableflip.

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.