Skip to content

Classify mid-CDC SSH tunnel failures as connectivity errors#4443

Merged
dtunikov merged 2 commits into
mainfrom
fix/ssh-tunnel-cdc-error-classification
Jun 19, 2026
Merged

Classify mid-CDC SSH tunnel failures as connectivity errors#4443
dtunikov merged 2 commits into
mainfrom
fix/ssh-tunnel-cdc-error-classification

Conversation

@dtunikov

Copy link
Copy Markdown
Collaborator

What

When an SSH tunnel's keepalive fails mid-CDC, the Postgres connector proactively closes the replication connection. That surfaces in the CDC loop as a generic ReceiveMessage failed error which — depending on the underlying type — could fall through to the unclassified OTHER bucket (NotifyTelemetry) and page us, even though tunnel failures are retriable and almost always customer-side.

SSH setup failures were already classified as NOTIFY_CONNECTIVITY; this closes the gap for failures that happen during CDC while the tunnel is open.

Changes

  • New SSHTunnelConnectionError exception type.
  • CDC PullCdcRecords wraps the read error in it when p.ssh.IsBad().
  • Classifier maps it to NOTIFY_CONNECTIVITY (notify user, no page), placed before the generic net.* matchers so the tunnel context isn't lost.
  • SSHTunnel.badTunnel is now atomic.Bool (read from the CDC loop) + nil-safe IsBad() accessor.
  • Added classifier unit test.

🤖 Generated with Claude Code

When an SSH tunnel's keepalive fails, the Postgres connector proactively
closes the replication connection, which surfaces in the CDC loop as a
generic ReceiveMessage error. Depending on the underlying type it could
fall through to the unclassified OTHER bucket and page us, even though
tunnel failures are retriable and almost always customer-side.

Tag the error with a new SSHTunnelConnectionError when the tunnel is bad,
and classify it as NOTIFY_CONNECTIVITY (notify user, no page). Also make
SSHTunnel.badTunnel atomic since it is now read from the CDC loop.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@dtunikov
dtunikov requested a review from a team as a code owner June 18, 2026 14:05
@claude

claude Bot commented Jun 18, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@dtunikov
dtunikov merged commit 8d99a2a into main Jun 19, 2026
16 checks passed
@dtunikov
dtunikov deleted the fix/ssh-tunnel-cdc-error-classification branch June 19, 2026 11:56
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.

2 participants