• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 24212213832
66%

Build:
DEFAULT BRANCH: main
Ran 09 Apr 2026 08:46PM UTC
Jobs 1
Files 617
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

09 Apr 2026 08:39PM UTC coverage: 65.18% (+0.07%) from 65.108%
24212213832

push

github

web-flow
Route MCP sessions to the originating backend pod using httptrace (#4673)

* Route MCP sessions to the originating backend pod using httptrace

When a proxy runner pod restarts it recovers sessions from Redis but
backend_url stored the ClusterIP, so kube-proxy could send follow-up
requests to a different backend pod that never handled initialize —
causing JSON-RPC -32001 "session not found" errors on the first request.

Use net/http/httptrace.GotConn to capture the actual backend pod IP
after kube-proxy DNAT on every initialize request, and store that as
backend_url instead of the ClusterIP URL. The existing Rewrite closure
already reads backend_url and pins routing to the correct pod; no
changes to that path are needed.

When the backend pod is later replaced (rescheduled to a new IP or
restarted in place and lost in-memory session state), the proxy now
re-initializes the backend session transparently rather than returning
404 to the client:

- Dial error (pod IP unreachable): re-init triggers on TCP failure
- Backend 404 (session lost, same IP): re-init triggers on response

In both cases the proxy replays the stored initialize body against the
ClusterIP, captures the new pod IP via GotConn, stores the new backend
session ID, rewrites outbound Mcp-Session-Id headers, and replays the
original client request — the client sees no error.

DELETE responses are excluded from the 404 re-init path since the
session is intentionally torn down in that case.

Closes #4575

* Reimplement tracingTransport logic + add e2e tests

Extract re-initialization logic from tracingTransport into a dedicated
backendRecovery type backed by a narrow recoverySessionStore interface
(Get + UpsertSession) and a forward func. tracingTransport now owns only
the request lifecycle (session guard, initialize detection, httptrace,
session creation) and delegates all forwarding and recovery to
backendRecovery.

This makes reinitializeAndReplay and podBackendURL testable without
standin... (continued)

152 of 164 new or added lines in 1 file covered. (92.68%)

22 existing lines in 5 files now uncovered.

56838 of 87202 relevant lines covered (65.18%)

62.13 hits per line

Uncovered Changes

Lines Coverage ∆ File
12
83.11
3.26% pkg/transport/proxy/transparent/transparent_proxy.go

Coverage Regressions

Lines Coverage ∆ File
9
22.99
-0.57% pkg/client/manager.go
5
82.6
-0.21% pkg/vmcp/composer/workflow_engine.go
3
71.85
-1.11% pkg/ignore/processor.go
3
70.0
-3.33% pkg/state/local.go
2
95.68
-1.44% pkg/vmcp/composer/template_expander.go
Jobs
ID Job ID Ran Files Coverage
1 24212213832.1 09 Apr 2026 08:46PM UTC 617
65.18
GitHub Action Run
Source Files on build 24212213832
  • Tree
  • List 617
  • Changed 10
  • Source Changed 1
  • Coverage Changed 10
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24212213832
  • d851c69f on github
  • Prev Build on main (#24212190051)
  • Next Build on main (#24227816235)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc