Skip to content

[SSH] Report port forwarding refusals as their own telemetry categories - #7064

Merged
anton-107 merged 2 commits into
mainfrom
ssh-telemetry-port-forwarding-categories
Oct 19, 2026
Merged

anton-107 merged 2 commits into
mainfrom
ssh-telemetry-port-forwarding-categories

Conversation

@anton-107

@anton-107 anton-107 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Changes

Two new SshTunnelErrorCategory values for the port forwarding refusals added in #7057 and #7063:

Category Reported when Before
PORT_FORWARDING_DISABLED The up-front read of port_fwd_serverless_enabled returns false, before any compute is started UNKNOWN
DRIVER_PROXY_FORBIDDEN The driver proxy refuses a request to the SSH server with a 403, for a server that was already running or for one that this connection started SERVER_START_TIMEOUT

Both acceptance tests now also check the error_category in the uploaded telemetry event.

Why

PR 3 of DECO-28889, after #7057 and #7063. Without these, a disabled setting shows up as slow server starts or as CLI bugs. Keeping the two apart shows how often the setting can't be read (production today) and the proxy's 403 has to catch it.

The backend enum needs the matching values: https://github.com/databricks-eng/universe/pull/2802257. Either PR can land first; until the universe one does, ingestion drops these values.

Tests

  • acceptance/ssh/connect-serverless-port-forwarding-disabled reports PORT_FORWARDING_DISABLED.
  • acceptance/ssh/connect-serverless-feature-disabled reports DRIVER_PROXY_FORBIDDEN.
  • All acceptance/ssh tests and experimental/ssh/... unit tests pass.

This pull request and its description were written by Isaac.

@anton-107
anton-107 requested review from a team as code owners October 14, 2026 15:21
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: b38d473

Run: 39216762252

Env ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 276 17 5:17
✅​ aws-windows-latest-4core-16gb 278 15 4:09
✅​ azure linux-2core-8gb 275 17 5:12
✅​ azure-windows-latest-4core-16gb 277 15 3:24
✅​ gcp linux-2core-8gb 276 17 5:14
✅​ gcp-windows-latest-4core-16gb 278 15 3:54
Top 6 slowest tests (at least 2 minutes):
duration env testname
4:02 aws-windows-latest-4core-16gb TestAccept
3:48 gcp-windows-latest-4core-16gb TestAccept
3:43 aws linux-2core-8gb TestAccept
3:39 azure linux-2core-8gb TestAccept
3:36 gcp linux-2core-8gb TestAccept
3:19 azure-windows-latest-4core-16gb TestAccept

@mihaimitrea-db mihaimitrea-db 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.

Not sure why my approval is needed? Could this signal something weird into our ownership system?

@anton-107 change LGTM I can approve if this was intentional.

@anton-107
anton-107 force-pushed the ssh-preflight-port-forwarding-setting branch from 1ea406f to a84b403 Compare October 16, 2026 12:59
@anton-107
anton-107 requested a review from rugpanov October 16, 2026 13:19
Base automatically changed from ssh-preflight-port-forwarding-setting to main October 16, 2026 14:24

@rugpanov rugpanov 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.

LGTM. Before you merge, rebase this branch onto the updated base. It still contains the old commits from #7057 and #7063. Because of this, GitHub shows 18 files instead of 6 and reports a merge conflict. Run git rebase --onto origin/ssh-preflight-port-forwarding-setting a441f86cf. Your commit applies to a84b40362 without conflicts, and the SSH unit tests and the two acceptance tests pass there.

Comment thread libs/telemetry/protos/ssh_tunnel.go Outdated
// (port_fwd_serverless_enabled), read from the setting before any compute was started.
SshTunnelErrorCategoryPortForwardingDisabled SshTunnelErrorCategory = "PORT_FORWARDING_DISABLED"

// The driver proxy refused the SSH server with a 403 after its run was submitted. Usually

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.

[nice to have] This comment says that the 403 comes "after its run was submitted". But ensureSSHServerIsRunning also returns errDriverProxyForbidden from its first getServerMetadata call, before it submits a run. This occurs when a metadata.json file from an earlier connection exists. Thus a person who reads the data can think that each DRIVER_PROXY_FORBIDDEN row started compute. Change the text to "refused a request to the SSH server with a 403, for a server that was already running or for one that this connection started". Make the same change in the enum.proto comment in databricks-eng/universe#2802257 and in the table in the PR description.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in b38d473. You're right that the first getServerMetadata call returns the 403 before any submit when an earlier connection's metadata.json exists. I updated the comment and the PR description table. I'll update the enum.proto comment in databricks-eng/universe#2802257 separately.

anton-107 and others added 2 commits October 19, 2026 07:29
Both refusals from the previous changes were reported as
SERVER_START_TIMEOUT (the driver proxy's 403) or UNKNOWN (the up-front
setting check), so they looked like slow server starts or CLI bugs.
They now report PORT_FORWARDING_DISABLED when the setting check stops
the connection before any compute is started, and DRIVER_PROXY_FORBIDDEN
when the driver proxy refuses the server after its run was submitted.
Keeping them apart shows how often the setting can't be read and the
proxy has to catch it.

The values need the matching universe enum change to be stored.

DECO-28889

Co-authored-by: Isaac <no-reply@databricks.com>
…erver

Co-authored-by: Isaac <no-reply@databricks.com>
@anton-107
anton-107 force-pushed the ssh-telemetry-port-forwarding-categories branch from 3451727 to b38d473 Compare October 19, 2026 07:32
@anton-107
anton-107 enabled auto-merge October 19, 2026 07:42
@anton-107
anton-107 added this pull request to the merge queue Oct 19, 2026
Merged via the queue into main with commit f5801e2 Oct 19, 2026
27 checks passed
@anton-107
anton-107 deleted the ssh-telemetry-port-forwarding-categories branch October 19, 2026 08:12
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.

4 participants