Comments (5)
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.
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.
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.
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.
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)
- supervisord HOT 4
- [Question] Windows HOT 4
- Expose parent presence
- sometimes got error like "listen tcp xxx: bind: address already in use" when Upgrade HOT 4
- support unix socket HOT 2
- Logs go missing after systemd-journald restart HOT 2
- How to integrate with systemd and supervisor? HOT 2
- Impossible to build for windows HOT 2
- Add an example for supervisord integration HOT 1
- Enable SO_REUSEPORT HOT 1
- Allow multiple back-to-back graceful upgrades HOT 1
- Request for updating README.MD HOT 1
- Hello, is https not supported? HOT 1
- upg.Exit() do not effective in go routine ? HOT 1
- [Bug] Connections not closed on inherited net.Conn HOT 2
- Can't catch syscall.SIGINT after upgrade HOT 1
- how can i use it for rpcx restart
- Overseer HOT 3
- Upgrade function documentation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tableflip.