Re: [PATCH v3 11/11] builtin/receive-pack: stage incoming objects via ODB transactions
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 10, 2026, 16:52 UTC
- Message-ID
- <xmqqtsq6dbyb.fsf@gitster.g>
- In-Reply-To
- <alEBEbwOMFkVfuk9@denethor>
Justin Tobler <jltobler@gmail.com> writes:
Show 23 quoted lines
> On 26/07/08 08:49PM, Junio C Hamano wrote: >> Justin Tobler <jltobler@gmail.com> writes: >> > update_shallow_info(commands, &si, &ref); >> > } >> > use_keepalive = KEEPALIVE_ALWAYS; >> > - execute_commands(commands, unpack_status, &si, >> > + execute_commands(commands, unpack_status, &si, transaction, >> > &push_options); >> >> And in such a case, execute_commands() returns without committing >> the transaction. Is there a need to add and make an >> odb_transaction_abort() call or something in such a case? >> Everything should be cleaned up upon process exit, and on file based >> backends, we probably let the tempfile/lockfile API do their thing >> to clean up, but are there other things we may want to clean up? > > As you mentioned, if we exit before committing the ODB transaction, the > temporary directory will get cleaned up when the process exits. I don't > think there is anything else we need to cleanup that wouldn't be handled > at exit though. Regardless, I do plan to add `odb_transaction_abort()` > in a followup series and I think it would be nice to have an explicit > "abort" here when we know that we are not going to commit anyways. I > would like to defer this to my next series though.
Sounds good. We cannot trigger receive-pack as a subroutine call in a long running daemon until that happens, but that is OK for now. One step at a time.