CLI: close failure in main()'s finally becomes an unhandled rejection
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, node.js
- Domain
- cli
Research direction
Start in bin/rocksdb-js.mjs and compare the main() cleanup path with the EPIPE handler, which already reports database close failures. Ensure a close failure goes through reportError with exit code 1 while readline cleanup still runs. Done when close failures use the normal CLI error format and readline closes; exercise the failure path if the project has a relevant CLI test.
Written by the indexing model from the issue text.
Description
CLI: a close failure in main()'s finally becomes an unhandled rejection
In bin/rocksdb-js.mjs, main() ends with finally { r?.close(); closeAllDatabases(); rl?.close(); }. If closeAllDatabases() throws (for example a failed close-time flush), the exception escapes the async main() and surfaces as an unhandled rejection. Node prints a raw stack trace, --json error formatting is skipped, and the exit code and message differ from every other CLI failure, which goes through reportError.
The EPIPE handler already guards the same call with try/catch plus reportError and exit code 1. The finally path should do the same, and rl?.close() should still run when the database close fails.
Found by the pre-push review of the fix for #1081 (CLI: deferred review nits from the #1055 follow-ups). It is pre-existing and outside that PR's diff. The fix is small, and the failure needs a close error to occur at all.
Review-Deferral: ae136b39fe3e7414 severity=nit category=reliability
🤖 Generated by Claude Code (Anthropic Claude Sonnet 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 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
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
HarperFast/rocksdb-js#1122 ·
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