|
|
|
|
|
by aardvark179
4322 days ago
|
|
This is a great feature of Lisp, Smalltalk, and similar languages, in development. In production however it can be extremely bad since the source code you believe is needed to reconstruct an image may not be what is actually in there, or some bootstrapping may have been done by hand and incorrectly captured later on. If the image has been saved with this anomaly a couple of decades ago then it's really fun trying to sort it out. I've spent more time than I'd like to think doing software archeology to find out just why two systems behaved differently, so I would seriously recommend that if you do perform hot fixes in this manner then you reproduce the problem on a system built from source, apply and test the hot fix, make the change in the source and build your test system again to test, apply the hot fix to production, and schedule a redeploy. Fixing a live system can also be hazardous if you are replacing a function that may be on the stack at the moment, or if you are in any sort of multithreaded/process environment. Bugs become much harder to reason around and fix in those cases because there can be race conditions about which functions actually get called while you're applying your fix. TL;DR You can, but probably shouldn't. |
|
Nobody uses CL images that way, mostly because there aren't any CL implementations that produce images that are portable, and most implementations kill themselves to make the image (that's the easiest way to deal with memory allocation, multithreading, and open file descriptors). I've read about a couple of people trying but they don't get very far.
> Fixing a live system can also be hazardous if you are replacing a function that may be on the stack at the moment, or if you are in any sort of multithreaded/process environment. Bugs become much harder to reason around and fix in those cases because there can be race conditions about which functions actually get called while you're applying your fix.
This is a well known problem in Lisp-land, not because you're always hot-patching things in production, but because that's the way you develop code. There are a lot of things you can do to make atomic code loading possible, and different CL implementations have various levels of race condition proofing in the compiler and runtime systems.
> TL;DR You can, but probably shouldn't.
Most people who make this argument make it disingenuously or out of ignorance. I've heard it from people who don't seem to have any problems using ipython or pry or a SQL console to debug in production.