Describe the bug
nostream info (and nostream info --json) hangs forever instead of exiting or printing an error when the configured database is unreachable wrong host, DB down, network partition, etc.
The root cause is in getEventCount() (src/cli/commands/info.ts): it opens a knex connection pool for a single ad-hoc query. When the initial connection attempt itself fails or times out, the pool's destroy() call resolves without actually closing the underlying socket the in-flight connection attempt is left dangling, which keeps at least one open handle alive and prevents the Node process from ever exiting on its own.
To Reproduce
- Point the CLI at an unreachable/misconfigured database, e.g. an invalid
DB_HOST or a DB that isn't running. - Run
nostream info or nostream info --json. - The process never returns — no error, no timeout, no exit. It has to be killed manually
Confirmed directly via process._getActiveHandles(): after the pool's destroy() resolves, 5 leaked Socket handles are still present, which is what keeps the event loop alive.
Expected behavior
nostream info should either return a result or fail with a clear error/timeout within a bounded time, the same way every other CLI command already behaves when the database is unavailable it should never hang indefinitely.
System (please complete the following information)
- OS: Linux
- Platform: standalone / Docker Compose (reproduces in both the CLI's own DB access, not the
relay server) - Version: current
main
Describe the bug
nostream info(andnostream info --json) hangs forever instead of exiting or printing an error when the configured database is unreachable wrong host, DB down, network partition, etc.The root cause is in
getEventCount()(src/cli/commands/info.ts): it opens aknexconnection pool for a single ad-hoc query. When the initial connection attempt itself fails or times out, the pool'sdestroy()call resolves without actually closing the underlying socket the in-flight connection attempt is left dangling, which keeps at least one open handle alive and prevents the Node process from ever exiting on its own.To Reproduce
DB_HOSTor a DB that isn't running.nostream infoornostream info --json.Confirmed directly via
process._getActiveHandles(): after the pool'sdestroy()resolves, 5 leakedSockethandles are still present, which is what keeps the event loop alive.Expected behavior
nostream infoshould either return a result or fail with a clear error/timeout within a bounded time, the same way every other CLI command already behaves when the database is unavailable it should never hang indefinitely.System (please complete the following information)
relay server)
main