Subject: Re: [PATCH v3] tmp-objdir: skip clean up when handling a signal

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Wed, 28 Sep 2022 17:38:21 +0200

On Wed, Sep 28 2022, John Cai via GitGitGadget wrote:

> From: John Cai <[email-masked]>

This looks good! Just a clarifying question/comment:

> Since we can't do the cleanup in a portable and signal-safe way, skip
> the cleanup when we're handling a signal.
>
> This means that when signal handling, the temporary directory may not
> get cleaned up properly. This is mitigated by b3cecf49ea (tmp-objdir: new
> API for creating temporary writable databases, 2021-12-06) which changed
> the default name and allows gc to clean up these temporary directories.

I think this still doesn't cover the common case of the "atexit" handler
saving the day, as Jeff King pointed out in v1:

	https://lore.kernel.org/git/[email-masked]/

I think it's fine to have this proceed as-is (although if you're doing a
v4 anyway, maybe we want to update tho commit message). I.e. is it
correct that we'll now only skip this if we get a signal, *and* it's a
fatal signal, or we otherwise die/exit/abort/whatever before we can get
to our atexit() handler?