4 ms·
I thought this was going to be replacing the process, but it appears to be a tool for replacing the binary on disk? Am I reading the code right? Why would you
by dijit 7y ago
I thought this was going to be replacing the process, but it appears to be a tool for replacing the binary on disk? Am I reading the code right?
Why would you want to do this without restarting the process? Isn't hot-reload a much more desirable thing?
and, to that end, replacing a binary in place just ensures that what's running cannot be re-run on stop, so you could end up in a situation where you've overwritten a working binary with a nonworking one which could obfuscate critical information when trying to recover service.
- adamnemecek 7y agoIt's for desktop application. It's an alternative to sparkle https://en.wikipedia.org/wiki/Sparkle_(software) https://en.wikipedia.org/wiki/Sparkle_(software)
- zamadatix 7y agoThese don't exclude each other, you can do both if you wanted. This is true of any self contained updater.
- zamalek 7y agoHot reload is such a difficult goal, especially if there are kernel/out-of-process resources (such as network connections) involved. I'm sure everyone believes that hot reload is the answer, there are probably fewer than 5 projects where it has been done, and all those projects likely have some seriously PHD-level code. Beyond the most extreme manual and cognitive effort, hot reload is completely and utterly unsolved.
- cperciva 7y agoNetwork connections aren't the hardest problem; you can hand those across Unix sockets. The fundamental problem with hot reload is that data structures can change. If the old process has a priority queue implemented as a linked list and the new process has a priority queue implemented as a heap, how on earth is any automated mechanism going to copy the state across?
- yorwba 7y agoChanging the running code but keeping the data in memory is equivalent to changing the code but keeping the data in the database. Changing data-structure definitions is equivalent to changing the database schema. If you want to change the database schema without losing data, you need to write a migration. If you want to hot-reload code with different data-structure definitions, you'll have to write a migration. A hot-reloading solution for a statically typed programming language will at minimum have to detect whether data structures have changed and either prevent the reload or require that the new code includes a function to migrate the data.
- Joker_vD 7y agoObviously, you write a code_change/3 function that updates the old state to the new shape or, if asked to do so, downgrades the new state back to the old shape :)
- lkschubert8 7y agoI guess you could come up with some concept of migrations for data structures?
- pjmlp 7y agoIn languages like Common Lisp it is quite well solved, even in space. http://www.flownet.com/gat/jpl-lisp.html http://www.flownet.com/gat/jpl-lisp.html > The Remote Agent software, running on a custom port of Harlequin Common Lisp, flew aboard Deep Space 1 (DS1), the first mission of NASA's New Millennium program. Remote Agent controlled DS1 for two days in May of 1999. During that time we were able to debug and fix a race condition that had not shown up during ground testing. (Debugging a program running on a $100M piece of hardware that is 100 million miles away is an interesting experience. Having a read-eval-print loop running on the spacecraft proved invaluable in finding and fixing the problem. The story of the Remote Agent bug is an interesting one in and of itself.)
- wtmt 7y agoIt’s an updater for programs. Consider it like Firefox or any other application updating itself. The update check and actual update are enabled by this one for Rust programs. Any notifications to the user or restarts should be handled by the program itself.