Follow-ups to the withLock() completion purge retry
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Read src/binding/database/db_descriptor.cpp and the releaseDescriptorPin() helper introduced by #1110; compare the existing retry sites in the backup/checkpoint state destructors and purgeAfterCommit(). The issue describes three follow-ups, including an allocation failure edge case and a Deno timing concern. Done means deciding which follow-ups to address and aligning completeLockCallback with the shared helper where appropriate.
Written by the indexing model from the issue text.
Description
Context
The #1092 fix (branch fix/withlock-purge-skip) makes withLock() completions in src/binding/database/db_descriptor.cpp retry DBRegistry::PurgeIfUnreferenced() after releasing their transient descriptor pin (completeLockCallback / LockCompletionPurge). Pre-push review left three follow-ups, all small and none reopening the leak.
Follow-ups
- Fold into the shared helper. This is the third copy of the "release the pin, then retry the purge" tail, after the backup/checkpoint state destructors and
purgeAfterCommit(). #1110 addsreleaseDescriptorPin()for it. Whichever of #1110 and the #1092 fix merges second should switchcompleteLockCallbackto it. Consider whether the helper should carry the lock completion's post-releaseuse_count() == 1fast path, which keeps ordinary completions offdatabasesMutex. - Allocation failure loses the retry.
descriptorKey()copies the path strings while the second, brief pin is held. If that copy throws, the pin is released with no retry. Every existing retry site has the same best-effort limit. Making the key copy non-throwing (for example, caching the key on the descriptor) would close it for all of them. - Purge runs after the caller's promise settles. This matches commit completion, so a possible close-time flush never runs ahead of the caller's continuation. On Deno, which runs the continuation inside the settle call, that continuation can briefly see an unreferenced database still registered. Deno is local-only and unsupported, so this is noted rather than fixed.
Review-Deferral: 0c80b1bff4f36a9c severity=nit category=maintainability
Review-Deferral: 4511645710d48f61 severity=nit category=concurrency
Review-Deferral: 2f0dfed9b51352fa severity=minor category=reliability
🤖 Generated with Claude Code (Claude Opus 5.5); posted via @cb1kenobi.
- Dominant language
- C++
- Stars
- 24
- Forks
- 3
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 102
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from HarperFast/rocksdb-js
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
HarperFast/rocksdb-js#1131 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarperFast/rocksdb-js#1118 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
HarperFast/rocksdb-js#1133 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 43/100
HarperFast/rocksdb-js#1125 ·
Maintainers usually reply within 1 day
-
A durable commit is reported as failed when aftercommit hits a database closed after the commitPossibly taken @cb1kenobi claimed this today. Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
HarperFast/rocksdb-js#1117 ·
Maintainers usually reply within 1 day
All issues in HarperFast/rocksdb-js
Similar issues
-
area/daemon bug good first issue platform/linux priority/p2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ToshiNamura/Deimos#5 ·
-
needs-format
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Niko1221/Strata#6251 · 1 comment ·
Maintainers usually reply within 5 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
metasequoiaime/msime#11666 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
patrick-hudson/put.gd-desktop#1679 · 1 comment ·
Maintainers usually reply within 1 day
-
Detokenizer keeps ▁ for BPE tokenizers with a top-level Metaspace decoder (NLLB, Reformer)Possibly taken @0z5a claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openvinotoolkit/openvino_tokenizers#840 ·
Maintainers usually reply within 1 day