Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix(cluster): skip responses after IPC disconnect - #787

#787
Closed
alencristen wants to merge 2 commits into
prometheus:mainprometheus/client_js:mainfrom
alencristen:fix/cluster-worker-disconnectalencristen/client_js:fix/cluster-worker-disconnectCopy head branch name to clipboard
Closed

fix(cluster): skip responses after IPC disconnect#787
alencristen wants to merge 2 commits into
prometheus:mainprometheus/client_js:mainfrom
alencristen:fix/cluster-worker-disconnectalencristen/client_js:fix/cluster-worker-disconnectCopy head branch name to clipboard

Conversation

@alencristen

Copy link
Copy Markdown

Fixes #563.

Stops cluster workers from calling process.send() when metric collection finishes after their IPC channel has closed. Adds a regression test for a disconnect between request receipt and response.

Checks: npm test; focused cluster tests on Node 22, 24, and 26.

Signed-off-by: alencristen <299997878+alencristen@users.noreply.github.com>
Comment thread lib/cluster.js
if (message.type === GET_METRICS_REQ) {
Promise.all(registries.map(r => r.getMetricsAsJSON()))
.then(metrics => {
if (!process.connected) return;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that #778 has landed, this would be another good spot for debug output

Signed-off-by: Jason Marshall <jdmarshall@users.noreply.github.com>

@jdmarshall jdmarshall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of a few PRs ago, completely silent catch blocks are no longer allowed. Please copy the debug behavior seen in other filev.

@jdmarshall

Copy link
Copy Markdown
Contributor

This has been cherry-picked into #789 to deal with some extensive changes to this code.

@jdmarshall jdmarshall closed this Jul 28, 2026
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.

[BUG] ERR_IPC_CHANNEL_CLOSED showing up on new deployments

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.