Skip to content

Add app log stream affinity for scalable apps - #6742

Open
jerrylian-db wants to merge 4 commits into
databricks:mainfrom
jerrylian-db:apps-logs-scalable-affinity
Open

jerrylian-db wants to merge 4 commits into
databricks:mainfrom
jerrylian-db:apps-logs-scalable-affinity

Conversation

@jerrylian-db

Copy link
Copy Markdown

Changes

  • Warn when databricks apps logs is used with an app configured for more than one instance.
  • Send a per-command __Host-databricks-app-router cookie on log websocket handshakes for scalable apps.

Why

databricks apps logs --follow reconnects the websocket on transient failures. A stable routing cookie keeps reconnects best-effort affined to the same app instance, matching scalable Apps session affinity guidance.

Tests

  • go test ./cmd/apps ./libs/apps/logstream
  • ./task checks
  • ./task lint-q (Go lint passed; Python ruff fetch failed because PyPI DNS resolution failed)
  • ./task test (unit test phases passed; acceptance phase blocked because local jq is 1.6 and the suite requires jq >= 1.7)

This PR was written by Codex.

@github-actions

github-actions Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Approval status: pending

/cmd/apps/ - approved by @pkosiec

Files: cmd/apps/logs.go, cmd/apps/logs_test.go

/libs/apps/ - approved by @pkosiec

Files: libs/apps/logstream/streamer.go, libs/apps/logstream/streamer_test.go

General files (require maintainer)

Files: .nextchanges/cli/apps-logs-scalable-affinity.md
Based on git history:

  • @rugpanov -- recent work in .nextchanges/cli/

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db, @janniklasrose, @lennartkats-db, @rugpanov, @rclarey) can approve all areas.
See OWNERS for ownership rules.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 63565f6

Run: 35370433217

Env ✅​pass 🙈​skip Time
✅​ aws linux 276 15 4:25
✅​ aws windows 278 13 4:09
✅​ azure linux 275 15 4:10
✅​ azure windows 277 13 3:37
✅​ gcp linux 276 15 4:18
✅​ gcp windows 278 13 5:23
Top 3 slowest tests (at least 2 minutes):
duration env testname
5:21 gcp windows TestAccept
4:06 aws windows TestAccept
3:36 azure windows TestAccept

@pkosiec pkosiec left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overal LGTM, nice work 👍

Are there any plans to allow users to connect to a specific replica with a flag? That would be awesome.

@github-actions

Copy link
Copy Markdown
Contributor

An authorized user can trigger integration tests manually by following the instructions below:

Trigger:
go/deco-tests-run/cli

Inputs:

  • PR number: 6742
  • Commit SHA: 63565f6e2c109d3bd4345932db1619d540ea8485

Checks will be approved automatically on success.

This branch has not been deployed

No deployments
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.

3 participants