Skip to content

fix(cli): stop info command from hanging when database is unreachable - #740

Open
Priyanshubhartistm wants to merge 1 commit into
cameri:mainfrom
Priyanshubhartistm:fix/cli-info-event-count-hang
Open

fix(cli): stop info command from hanging when database is unreachable#740
Priyanshubhartistm wants to merge 1 commit into
cameri:mainfrom
Priyanshubhartistm:fix/cli-info-event-count-hang

Conversation

@Priyanshubhartistm

@PriyanshubhartistmPriyanshubhartistm commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Description

getEventCount() in src/cli/commands/info.ts opened a knex connection pool for a single ad-hoc query. When the initial connection attempt itself failed or timed out, the pool's destroy() resolved without actually closing the underlying socket, leaving an open handle behind and keeping the Node process alive indefinitely.

Replaces the knex pool with a raw pg.Client (connect() / query() / end()), which reliably closes its socket even when the connection attempt itself fails.

Related Issue

Closes#739.

Motivation and Context

nostream info (and nostream info --json) would hang forever with no error or timeout if the configured database was unreachable, instead of failing cleanly like every other CLI command.

Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 02d92eb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
NameType
nostreamPatch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 71.322% (-0.004%) from 71.326% — Priyanshubhartistm:fix/cli-info-event-count-hang into cameri:main

Sign up for freeto 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.

[BUG] nostream info hangs indefinitely when the database is unreachable

2 participants

@Priyanshubhartistm@coveralls