Skip to content

fix(telemetry): opt-out beacon tolerates a Service without an HTTP client (shuffle-lane crash) - #1289

Open
Dumbris wants to merge 1 commit into
mainfrom
fix/telemetry-optout-nil-client
Open

Dumbris wants to merge 1 commit into
mainfrom
fix/telemetry-optout-nil-client

Conversation

@Dumbris

@Dumbris Dumbris commented Sep 16, 2026

Copy link
Copy Markdown
Member

Why

Unit Tests (shuffle) on #1285 died in internal/telemetry with a nil-pointer panic in a goroutine — net/http.(*Client).do(0x0, …) from Service.SendOptOutBeacon, spawned fire-and-forget by NotifyConfigChanged. Several telemetry tests build the Service as a bare literal with no client; under an unlucky shuffle order the beacon goroutine outlives its test, passes the env/semver/anon-id guards and dereferences the nil client, taking the whole test binary down. Unrelated to the PR it hit (H0 touches no telemetry code).

What

SendOptOutBeacon returns an error when no client is configured instead of dereferencing it. Production always constructs the client (telemetry.go:570), so behaviour there is unchanged.

The seed (-shuffle=1789588229734730758) does not reproduce locally (timing-dependent), but the stack pins the cause.

🤖 Generated with Claude Code

…P client

NotifyConfigChanged fires the opt-out beacon from a goroutine; several
telemetry tests build the Service as a bare literal with no client, so
under an unlucky shuffle order the goroutine reached http.Client.Do on a
nil receiver and took the whole test binary down (Unit Tests (shuffle)
on #1285, seed 1789588229734730758). Refuse to send instead.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 43f7508
Status: ✅  Deploy successful!
Preview URL: https://4c2f8064.mcpproxy-docs.pages.dev
Branch Preview URL: https://fix-telemetry-optout-nil-cli.mcpproxy-docs.pages.dev

View logs

@github-actions

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: fix/telemetry-optout-nil-client

Available Artifacts

  • archive-darwin-amd64 (30 MB)
  • archive-darwin-arm64 (27 MB)
  • archive-linux-amd64 (18 MB)
  • archive-linux-arm64 (16 MB)
  • archive-windows-amd64 (30 MB)
  • archive-windows-arm64 (26 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (24 MB)
  • installer-dmg-darwin-arm64 (21 MB)
  • smart-mcp-proxymcpproxy-goX5RETF.dockerbuild (0 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 35144470954 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/telemetry/optout.go 0.00% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

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