Files
floci/src/test/java
Bill DeMoss 551df6371b fix(storage): dedupe backends by resolved file path (#1931)
* fix(storage): dedupe backends by resolved file path

StorageFactory.create() built a new backend on every call, so two
components opening the same file (DynamoDbService and
DynamoDbStreamService both open dynamodb-tables.json) got independent
in-memory stores. On graceful shutdown flushAll() flushed them in
registration order and the stale duplicate clobbered the file.

Cache backends by resolved file path so repeat create() calls reuse
the same backend. Add a regression test reproducing the clobber.

* fix(storage): guard lifecycle methods and harden dedup test

Synchronize loadAll/flushAll/clearAll/shutdownAll on the same monitor
as create(), so the /state/reset and /state/nuke endpoints can't
iterate allBackends while a lazily-created service mutates it.

Reset the singleton factory in the dedup test setup so it no longer
depends on backend startup state or test ordering.
2026-07-26 15:01:13 -05:00
..