Skip to content

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

Open
alencristen wants to merge 1 commit into
prometheus:mainfrom
alencristen:fix/cluster-worker-disconnect
Open

fix(cluster): skip responses after IPC disconnect#787
alencristen wants to merge 1 commit into
prometheus:mainfrom
alencristen:fix/cluster-worker-disconnect

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

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