Make TransactionHandle close exclude new work and fully drain in-flight operations
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 28/100
Research direction
Start with TransactionHandle::close and the getSync, putSync, removeSync, CommitSync, and getCount entry points, then compare the cleanup behavior in PR #780 with references #745 and #746. Add deterministic regressions for the listed teardown, registration, and synchronous-operation races. Done means close rejects new work and native state, VT intents, log state, and the owning database handle remain valid until all earlier operations finish.
Written by the indexing model from the issue text.
Description
Parent: #741
Problem
TransactionHandle::close() and transaction entry points do not share one lifecycle gate:
closed.exchange(true)is separate from async-work registration, so close can observe zero work and begin teardown immediately before another operation registers.- The current wait is bounded to five seconds, after which close mutates transaction-log state, releases VT intents, and deletes
txneven if native execution is still using it. state,txn,lockedVTSlots, andheldTrackershave cross-thread access without one complete synchronization contract.- Synchronous
getSync,putSync,removeSync,CommitSync, andgetCountremain outside the async-work drain mechanism.
PR #780 must make its new environment-cleanup reap safe for already-running native execution. This issue tracks the complete cross-environment close invariant, including entry points outside the narrow #780 fix.
Required invariant
After close begins, no new operation may acquire transaction state. Every operation that acquired it earlier must finish before state, txn, VT intents, log state, or the owning database handle can be mutated or destroyed.
Acceptance criteria
- Make the closed check and work/resource acquisition atomic with the start of close.
- Reject new operations once close has claimed the handle.
- Do not destroy native state after a timeout while work remains active; defer destruction or wait for definitive native completion.
- Synchronize transaction state and VT intent-vector ownership across close, commit, abort, reset, and release paths.
- Define and enforce the same safety contract for synchronous entry points without imposing an unjustified hot-path cost.
- Add deterministic regressions for:
- environment teardown during a native commit lasting longer than five seconds;
- close racing async work registration;
- close racing representative synchronous reads and writes.
Relationship
- Umbrella: #741
- #780 should resolve the already-running-work blocker in its new cleanup path.
- Previous partial implementation/reference: #745
- Related teardown symptom: #746
— KrAIs (Codex), on behalf of @kriszyp
- Dominant language
- C++
- Stars
- 22
- Forks
- 3
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 49
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 68/100
HarperFast/rocksdb-js#945 ·
Maintainers usually reply within 1 day
-
Drop Deno from CI and README (keep Deno-specific fixes)Possibly taken @cb1kenobi claimed this today. Open
HarperFast/rocksdb-js#947 · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 1-2 days Newbie friendliness 45/100
HarperFast/rocksdb-js#946 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
HarperFast/rocksdb-js#944 ·
Maintainers usually reply within 1 day
-
Durable-handle restore replays onto a partly rebuilt transaction; a failed capture leaves it unresetOpen
Difficulty 4/5 3-5 days Newbie friendliness 48/100
HarperFast/rocksdb-js#937 ·
Maintainers usually reply within 1 day
All issues in HarperFast/rocksdb-js
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
metasequoiaime/msime#9113 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
tone-3000/tone3000-plugin#257 · 1 comment ·
Maintainers usually reply within 1 day
-
Locked plugin flip-flops position on every refresh after being disabledPossibly taken @Illustar0 claimed this today. Openissue report
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
ModOrganizer2/modorganizer#2449 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
enhancement P5
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
open-astro/AlpacaBridge#1468 ·
Maintainers usually reply within 1 day