Simon: I think it's very likely harmless
Darcs developers: At the very least, exposing these sorts of developer-
oriented messages to the user is a UI bug.
The subtlety here being that we need to ask ourselves why we're emitting
these errors so that we're not just sweeping any fundamental problems
under the rug. How exactly does it happen that Darcs tries to call
atexit when it's already too late? We need-action somebody to
understand the Darcs.Global code and explain what could cause this to
arise. I'm afraid it's not super clear to me. Although by process of
elimination below, I think it's probably checkWaitToStart, which seems
plausible if we have this speculation mechanism... Can somebody confirm?
The atexit function is just a trick Darcs provides to register actions
that should happen when Darcs is exiting
<http://darcs.net/src/Darcs/Global.hs>, normally along the lines of
removing temporary files or directories.
Grepping the code, I see XXX uses of atexit:
1. killing the SSH control master (probably not Simon)
2. Darcs.URL.checkWaitToStart - not sure what this is, but seems to be
removing some temporary file
3. Emitting a gzcrcs warning (not Simon?)
4. Darcs.Lock.withDir Delayed - creates a temporary directory and
(depending on flags), deletes it on darcs exit (I can only see one
instance where this is used [in darcs show files])
5. Listing bad caches (new feature to be introduced in Darcs 2.8, so not
Simon)
Also, one implementation suggestion. Maybe atexit should take a String
description along with the action being registered. At least then we
could have a better idea what it's too late to call atexit on?
|