Skip to content

feat(session): add single-connection transport#1270

Draft
cardyok wants to merge 3 commits into
mainfrom
cardyok/feat-lep-5352-single-session
Draft

feat(session): add single-connection transport#1270
cardyok wants to merge 3 commits into
mainfrom
cardyok/feat-lep-5352-single-session

Conversation

@cardyok

@cardyok cardyok commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add the v2 bidirectional gRPC session transport while keeping v1 as the default
  • multiplex commands, results, and heartbeats with bounded messages, handshake deadlines, and heartbeat cancellation
  • preserve session protocol selection across gpud up and auto-update, and reconnect either transport after token rotation
  • send the control-plane origin metadata required by the gateway CSRF filter

Rollout

v1 remains the default. v2 is enabled explicitly with --session-protocol=v2 only after the matching Lepton gateway and gpud-manager changes are deployed. auto falls back only when the v2 service returns gRPC UNIMPLEMENTED.

Related Lepton MR: https://gitlab-master.nvidia.com/dgxc-lepton/lepton/-/merge_requests/7763

Verification

  • go build ./...
  • go test -race -gcflags='all=-N -l' ./pkg/session/... ./pkg/gpud-manager/systemd ./pkg/config ./cmd/gpud/command ./cmd/gpud/run ./cmd/gpud/up -count=1
  • custom golangci-lint on all changed packages: 0 issues
  • normalized Lepton/GPUd protobuf schemas and deterministic wire golden tests match

Full go test -gcflags='all=-N -l' ./... -count=1 is blocked by existing environment-sensitive tests: Docker ping does not time out when no daemon is available, and the pstore restricted-file assertion is not valid under the current runner permissions. All changed-package tests pass.

DEV end-to-end rollout validation is deferred until the paired Lepton changes are available.

Jira

LEP-5352

Co-Authored-By: Codex <noreply@openai.com>
@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.66667% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.72%. Comparing base (f0e21ed) to head (3101798).

Files with missing lines Patch % Lines
pkg/session/session_v2.go 89.92% 20 Missing and 7 partials ⚠️
pkg/gpud-manager/systemd/systemd.go 91.30% 2 Missing ⚠️
pkg/session/update.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1270      +/-   ##
==========================================
+ Coverage   90.68%   90.72%   +0.03%     
==========================================
  Files         351      353       +2     
  Lines       26997    27346     +349     
==========================================
+ Hits        24482    24809     +327     
- Misses       1702     1719      +17     
- Partials      813      818       +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

cardyok and others added 2 commits July 15, 2026 04:29
Exclude generated protocol stubs from patch coverage while exercising the
reconnect, heartbeat, endpoint, and error-classification behavior directly.

Co-Authored-By: Codex <noreply@openai.com>
Verify a parent cancellation during the active stream stops the v2 retry loop
without scheduling another connection.

Co-Authored-By: Codex <noreply@openai.com>
@gyuho gyuho self-assigned this Jul 17, 2026
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