[squeak-dev] a few small quit issues I want to note

Chris Muller asqueaker at gmail.com
Sat Sep 12 20:08:56 UTC 2020


Hi Eliot,

>> Hi Eliot, may I recommend the "flat-line your image" hot key?  It's
>> really useful for that and other use cases like debugging shutdown
>> code, or when Morphic gets slammed with events due to a bug that
>> disrupts the UI.  It calls Smalltalk quitPrimitive, so skips all
>> shutdown processing and logging.  It's one of the global command keys,
>> Cmd+Shift+_.
>
> Thanks.  However quitting via quitPrimitive is a bad idea.  Soon enough we will have a system with ephemerons around files and could expect file vuffers etc to be flushed before exit.  So we will want to run pending finalization actions, etc.  exiting via the quit primitive without running these activities could well break some applications.

It's a bad idea as normal course, yes, but a godsend when all you want
to do is stop the process immediately before system memory fills up
(e.g., in a stack-recursion bug scenario).

#quitPrimitive has also been used for Magma's db-recovery test case
since forever.  It was the easiest way to simulate the reality that
processes can and do get killed at inopportune times, and allowed me
to place it at exactly the worst place possible for Magma (e.g., write
of a commit, but prior to flush).  It may not run pending
finalizations, but I do believe I observed #quitPrimitive properly
closing open file handles (or, maybe the VM?).

The point is, #quitPrimitive does have a couple of use cases,
including even with its dangerous aspects.

>> With those two easily-accessible paths to a non-logging exit for the
>> user, I hope we won't rush into changing the logging of
>> exit-without-save.  That's a pretty legacy feature that I do use
>> occasionally to help me keep track of which images I'm looking at,
>> without wanting to change their .image file timestamp.
>
> OK, I abandon the idea.  Forget I said anything.

Your call.  There's a lot of ground between not rushing and full
abandonment.  I simply wanted a moment to be able to think about it.
Not logging when there is no change sounds reasonable at first blush,
but there are also Squeak systems that run a fixed image that don't
save on exit -- it may be useful for operators of those systems to be
able to know when there were interactions with the system, regardless
whether development causing .changes changes was done or not.

>> That SoundPlugin one does sound like one to optimize, but for the
>> Form, I think you want that processing because it's about what bits
>> you want to record in the image file, regardless whether continuing
>> the session.
>
> No, the Form thing is compressing forms so they take less space in the image file.  A complete waste of time if one is merely quitting.

Yes, you're right.  I was thinking about save+exit vs. save+continue,
but you're referring to quit+no save.

 - Chris


More information about the Squeak-dev mailing list