• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

decentraland / catalyst-storage / 30286356801

27 Jul 2026 04:47PM UTC coverage: 93.455% (-0.8%) from 94.216%
30286356801

push

github

web-flow
fix!: stop losing writes to a parked inflation, and stop reads faulting on provably-absent ids (#121)

* fix!: stop losing writes to a parked inflation, and stop reads faulting on provably-absent ids

A deep bug hunt across the whole library, plus an adversarial re-review of the
fixes themselves. Two of the fixes from the first pass were REVERTED after the
re-review showed they were worse than the holes they covered; see below.

The two that mattered most:

- A range read parked waiting for an inflation slot held no invalidation token,
  because the token was registered only after that wait. It woke with a fresh
  one, inflated the superseded gzip and renamed that stale output over the
  primary a concurrent store had just committed. The id then served the PREVIOUS
  version permanently: reconcile dropped the counterpart at the next boot, so
  the old bytes became its only representation, with `exist()` true and
  `allFileIds()` listing it normally. For hash-addressed content that means
  serving bytes that do not match their id. The token is now registered
  synchronously, and the commit re-checks what occupies the target path under
  the lock before renaming onto it.

- LRU/TTL eviction checked pins when it SELECTED a victim and then awaited the
  path lock, so a pin taken inside that window was invisible: `retrieve()`
  handed back a lazy item whose `asStream()` then failed ENOENT for content that
  was present. `evictEntry` re-checks pins under the lock, and readers await a
  new `cache.settle()` so a stat cannot race an unlink already committed to.

Also fixed:

- `statForRead` re-threw ENAMETOOLONG when the PARENT path was over-long too, so
  reads of a provably-absent id rejected with a raw errno and one such id failed
  a whole `existMultiple` batch while `delete` resolved.
- A directory at an id's uncompressed path made every range read of it reject
  with a bare EISDIR forever, while whole-file reads succeeded.
- `ensureDirectoryFor` used `e... (continued)

802 of 911 branches covered (88.04%)

Branch coverage included in aggregate %.

1397 of 1442 relevant lines covered (96.88%)

1330.98 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.2
/src/folder-based/decompress-cache.ts


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc