]> git.ipfire.org Git - thirdparty/FORT-validator.git/commit
Index each cache node separately
authorAlberto Leiva Popper <ydahhrk@gmail.com>
Mon, 20 Jan 2025 17:37:58 +0000 (11:37 -0600)
committerAlberto Leiva Popper <ydahhrk@gmail.com>
Tue, 21 Jan 2025 22:40:39 +0000 (16:40 -0600)
commitc47338b9449fc8171ba2e6513f4562d9d3d6eb34
tree80507a6322ca3585629add0c469b29c308bd3ba6
parent5024707204c64760c3a5ee4532d4b53aaf4906d0
Index each cache node separately

Background:

- Fort shouldn't lose the cache index when a signal interrupts it.
- Writing the index during the signal handler is not possible,
  because of the async-signal-safe requirement.
- Writing the index outside of the signal handler is seemingly not
  viable, because of the infelicities between the signal and
  multithreading APIs in C.

I haven't completely discarded the "dropping multithreading" option,
but since it seems disproportionate, I've been rethinking the index.

This commit scatters the index across several files, to minimize lost
information during a stopping signal. This will exacerbate the inode
problem, but that's temporary.

Reverts e0880f8eac3d35e576a2c1a2cb588424ab4b3e1b.
16 files changed:
src/cache.c
src/file.c
src/file.h
src/json_util.c
src/json_util.h
src/log.h
src/object/certificate.c
src/object/manifest.c
src/rrdp.c
src/rrdp.h
src/types/str.c
src/types/str.h
test/Makefile.am
test/cache_test.c
test/rrdp_test.c
test/rrdp_update_test.c