Skip to content

Fix closeMetricsServer sending wrong ID to metrics process - #428

Merged
ravjotbrar merged 1 commit into
mainfrom
fix/metrics-close
Jul 29, 2026
Merged

Fix closeMetricsServer sending wrong ID to metrics process#428
ravjotbrar merged 1 commit into
mainfrom
fix/metrics-close

Conversation

@ravjotbrar

Copy link
Copy Markdown
Collaborator

Description

Fix metrics servers not shutting down on connection delete. The close request was sending the full connectionId (host-port-dbN) but the metrics process expects its own nodeId (host-port).

Problem:

When deleting a connection, closeMetricsServer sends a POST to the metrics process's /connection/close endpoint. The metrics process validates connectionId !== ownNodeId and rejects with 400 because:

  • Sent: 127-0-0-1-7000-db0 (full connectionId)
  • Expected: 127-0-0-1-7000 (db-stripped nodeId)

Result: "Could not kill metrics server process" — orphaned metrics processes accumulate.

Fix:

Send nodeId (already computed at the top of the function) instead of connectionId in the request body:
body: JSON.stringify({ connectionId: nodeId })

Testing:

  • 2 new tests: verifies close sends db-stripped nodeId, verifies no-op when other
    connections still reference the same node
  • 186 server tests pass

Signed-off-by: ravjotb <ravjot.brar@improving.com>
@ravjotbrar ravjotbrar linked an issue Jul 29, 2026 that may be closed by this pull request
@ravjotbrar
ravjotbrar requested review from ArgusLi and nassery318 July 29, 2026 19:57
@ravjotbrar
ravjotbrar merged commit 358d19a into main Jul 29, 2026
8 checks passed
ravjotbrar added a commit that referenced this pull request Jul 29, 2026
Signed-off-by: ravjotb <ravjot.brar@improving.com>
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.

Metrics servers not killed on connection delete (ID mismatch)

2 participants