Skip to content

Shut down chdb-core before Node process exit - #98

Merged
ShawnChen-Sirius merged 2 commits into
mainfrom
codex/node-core-26-9-exit-shutdown
Oct 23, 2026
Merged

ShawnChen-Sirius merged 2 commits into
mainfrom
codex/node-core-26-9-exit-shutdown

Conversation

@ShawnChen-Sirius

@ShawnChen-Sirius ShawnChen-Sirius commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Fix the macOS process-exit hang exposed by the chdb-core v26.9.0 release check. The addon built and basic tests passed, but a spawned codegen CLI could finish its query and then block inside libchdb static teardown.
  • Close live connections and call chdb_shutdown() from the process-wide exit backstop. Register that callback after the first successful chdb_connect() so it runs before the engine teardown; keep Node environment cleanup connection-only.
  • Add a bounded async-query process-exit regression and a timeout for the existing codegen subprocess test.

Verification

Tested with the official chdb-core v26.9.0 macOS arm64 release library. The codegen subprocess hung before the fix and exits successfully after it.

  • npm test: 24 passed
  • npm run test:durable:node: 24 passed
  • Vitest excluding agents-tool.test.ts: 461 passed, 11 skipped (42 files)

The excluded network-blackhole integration test timed out in this local environment; the remaining platforms and full suite need PR CI. This does not change the currently pinned engine v26.7.3.

Fixes #97

Note

Shut down chdb-core before Node process exit

  • Adds shutdown_on_process_exit in chdb_node.cpp, a process-wide exit handler that closes all registered connections and then runs engine shutdown.
  • Moves exit-handler registration in get_default_conn and acquire_session_conn to after a connection opens successfully, so failed connection creation no longer registers cleanup.
  • Adds a teardown test in engine-exit.test.ts that runs an async query in a child Node process and asserts it exits within 15 seconds with no stderr output.
  • Also pins the MinIO-compatible Silo image (with digest) in the durable-S3 CI job and adds a 15-second timeout to the built CLI end-to-end test.

Macroscope summarized fa0afaf.

@ShawnChen-Sirius
ShawnChen-Sirius merged commit d92f245 into main Oct 23, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Engine check: chdb-core v26.9.0 — FAILS

1 participant