summaryrefslogtreecommitdiff
path: root/t/unit-tests/t-basic.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-03-25 11:02:46 +0100
committerJunio C Hamano <gitster@pobox.com>2024-03-25 09:51:11 -0700
commit33358350eb857a5fb273d143dcdfe15ac6d4db5d (patch)
tree651ca9551f19ea55135a19c59bc0381a24c64034 /t/unit-tests/t-basic.c
parentaf18098c9d2b2e165aca127c35eeb98d157bd542 (diff)
reftable/stack: use error codes when locking fails during compaction
Compaction of a reftable stack may fail gracefully when there is a concurrent process that writes to the reftable stack and which has thus locked either the "tables.list" file or one of the tables. This is expected and can be handled gracefully by some of the callers which invoke compaction. Thus, to indicate this situation to our callers, we return a positive return code from `stack_compact_range()` and bubble it up to the caller. This kind of error handling is somewhat awkward though as many callers in the call chain never even think of handling positive return values. Thus, the result is either that such errors are swallowed by accident, or that we abort operations with an unhelpful error message. Make the code more robust by always using negative error codes when compaction fails, with `REFTABLE_LOCK_ERROR` for the described benign error case. Note that only a single callsite knew to handle positive error codes gracefully in the first place. Subsequent commits will touch up some of the other sites to handle those errors better. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/unit-tests/t-basic.c')
0 files changed, 0 insertions, 0 deletions