You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] nostream info hangs indefinitely when the database is unreachable #739
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)
Activity