From: Patrick Steinhardt <ps@pks.im>
To: git@vger.kernel.org
Subject: Re: [PATCH 1/4] lockfile: report when rollback fails
Date: Wed, 6 Mar 2024 13:00:27 +0100 [thread overview]
Message-ID: <Zeha21vz6EJD8cnk@tanuki> (raw)
In-Reply-To: <lyarkcrkcb7ww542lc6y7t534yxnpahvrwephottvcbhr5dkn2@wwd5wk5bzlw7>
[-- Attachment #1: Type: text/plain, Size: 1924 bytes --]
On Tue, Mar 05, 2024 at 04:09:07PM -0600, Justin Tobler wrote:
> On 24/03/04 12:10PM, Patrick Steinhardt wrote:
> > We do not report to the caller when rolling back a lockfile fails, which
> > will be needed by the reftable compaction logic in a subsequent commit.
> > It also cannot really report on all errors because the function calls
> > `delete_tempfile()`, which doesn't return an error either.
> >
> > Refactor the code so that both `delete_tempfile()` and
> > `rollback_lock_file()` return an error code.
> >
> > Signed-off-by: Patrick Steinhardt <ps@pks.im>
> > ---
> > lockfile.h | 4 ++--
> > tempfile.c | 21 +++++++++++++--------
> > tempfile.h | 2 +-
> > 3 files changed, 16 insertions(+), 11 deletions(-)
> >
> > diff --git a/lockfile.h b/lockfile.h
> > index 90af4e66b2..4ed570d3f7 100644
> > --- a/lockfile.h
> > +++ b/lockfile.h
> > @@ -323,9 +323,9 @@ static inline int commit_lock_file_to(struct lock_file *lk, const char *path)
> > * for a `lock_file` object that has already been committed or rolled
> > * back.
> > */
> > -static inline void rollback_lock_file(struct lock_file *lk)
> > +static inline int rollback_lock_file(struct lock_file *lk)
> > {
> > - delete_tempfile(&lk->tempfile);
> > + return delete_tempfile(&lk->tempfile);
> > }
>
> question: For a lockfile that is already committed or rolled back, is
> the underlying tempfile still active? I'm trying to figure out if it
> possible for an error to be returned in this scenerio. If not, it might
> be nice to clarify in the comment above that, in addition to being a
> NOOP, no error is returned.
No, it's not. I thought that it being a no-op should be clear enough,
but on the other hand it doesn't hurt either to clarify even further.
I'll refrain from sending a v2 only to add this comment as there haven't
been any other things that need to be addressed yet.
Patrick
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2024-03-06 12:00 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-04 11:10 [PATCH 0/4] reftable/stack: register temporary files Patrick Steinhardt
2024-03-04 11:10 ` [PATCH 1/4] lockfile: report when rollback fails Patrick Steinhardt
2024-03-05 22:09 ` Justin Tobler
2024-03-06 12:00 ` Patrick Steinhardt [this message]
2024-03-04 11:10 ` [PATCH 2/4] reftable/stack: register new tables as tempfiles Patrick Steinhardt
2024-03-05 22:30 ` Justin Tobler
2024-03-06 11:59 ` Patrick Steinhardt
2024-03-06 16:34 ` Justin Tobler
2024-03-06 16:36 ` Junio C Hamano
2024-03-07 6:17 ` Patrick Steinhardt
2024-03-07 17:59 ` Junio C Hamano
2024-03-07 20:54 ` Patrick Steinhardt
2024-03-07 21:06 ` Junio C Hamano
2024-03-04 11:10 ` [PATCH 3/4] reftable/stack: register lockfiles during compaction Patrick Steinhardt
2024-03-05 23:30 ` Justin Tobler
2024-03-06 11:59 ` Patrick Steinhardt
2024-03-06 16:39 ` Junio C Hamano
2024-03-06 19:57 ` Justin Tobler
2024-03-04 11:10 ` [PATCH 4/4] reftable/stack: register compacted tables as tempfiles Patrick Steinhardt
2024-03-07 12:38 ` Toon claes
2024-03-07 12:58 ` Patrick Steinhardt
2024-03-07 13:10 ` [PATCH v2 0/4] reftable/stack: register temporary files Patrick Steinhardt
2024-03-07 13:10 ` [PATCH v2 1/4] lockfile: report when rollback fails Patrick Steinhardt
2024-03-07 13:10 ` [PATCH v2 2/4] reftable/stack: register new tables as tempfiles Patrick Steinhardt
2024-03-07 13:10 ` [PATCH v2 3/4] reftable/stack: register lockfiles during compaction Patrick Steinhardt
2024-03-07 13:10 ` [PATCH v2 4/4] reftable/stack: register compacted tables as tempfiles Patrick Steinhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zeha21vz6EJD8cnk@tanuki \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.