Skip to content

fix(doctor): requests-proxy check — result-egress framing + honest ✔ (cli#351 Part 1)#356

Merged
LukasWodka merged 2 commits into
developfrom
fix/doctor-requests-proxy-reword
Jul 21, 2026
Merged

fix(doctor): requests-proxy check — result-egress framing + honest ✔ (cli#351 Part 1)#356
LukasWodka merged 2 commits into
developfrom
fix/doctor-requests-proxy-reword

Conversation

@LukasWodka

@LukasWodka LukasWodka commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Fixes #351 (Part 1) · epic backend#1142 · stacked on #354 (merge #354 first; until then this PR's diff shows both commits).

Problem

The requests-proxy check had the direction backwards and overclaimed its ✔:

  • Said a down proxy makes experiments "stay Pending" — wrong path. requests-proxy is the outbound relay (pods POST results/FLOPs → Service Bus); scheduling is a separate inbound path jobs-manager consumes directly. A down proxy stalls result egress mid-run, it doesn't block scheduling. The old remedy misroutes triage.
  • The ✔ came from ReadyReplicas but there's no readiness probe (backend#1143), so "Ready" ≠ egress works.

Fix (Part 1 — CLI reword, S)

Reworded the doc comment + all three lines: remedies now say "result egress stalls mid-run (scheduling unaffected)"; the OK detail says "deployment-ready only; egress not directly probed." Status stays OK on a healthy install (no new ⚠, exit code unchanged). TestCheckRequestsProxy_Wording locks it (no "Pending"; honest ✔).

Deferred (Part 2)

A real in-cluster Service-Bus-egress probe needs the requests-proxy /healthz + readiness probe (backend#1143 + a client-runtime health endpoint) that don't exist yet — carved into a follow-up.

gofmt/vet clean; doctor + cli packages green.


Note

Low Risk
CLI-only diagnostic UX and messaging; no auth, data, or cluster mutation paths; exit codes unchanged for healthy clusters and tests cover the unreachable short-circuit.

Overview
Unreachable cluster: tracebloc doctor now passes ServerURL from kubeconfig into doctor.Run. If discovery fails with a transport error (isUnreachable), the sweep short-circuits: Cluster reachable is the single ✖ (names the API URL; loopback clusters get a start-Docker/k3d remedy), cluster-dependent checks return StatusUnknown (neutral info lines, no remedies), Worst() ignores unknowns, and Backend egress still runs from the local machine.

requests-proxy (cli#351 Part 1): Doc comment, fail remedies, and OK detail for Service Bus egress (requests-proxy) no longer claim experiments "stay Pending"; they describe mid-run result/FLOPs egress and note that Ready ≠ egress probed. TestCheckRequestsProxy_Wording and TestRun_UnreachableCascade lock behavior.

Reviewed by Cursor Bugbot for commit c4494cb. Bugbot is set up for automated code reviews on this repo. Configure here.

LukasWodka and others added 2 commits July 20, 2026 13:56
When the cluster API is unreachable (Docker/k3d stopped, wrong server,
network), doctor ran all 8 downstream checks anyway and each invented a
domain-specific cause with the wrong fix: PVC "usable StorageClass", proxy
"chart too old", requests-proxy "not found -> reinstall the chart", pods/RBAC
"kubeconfig user can list pods". The one true cause (cluster stopped) was
buried under ~6 false verdicts. Root mechanism: findDeployment/jobsManagerEnv
collapse an API transport error and genuine absence into the same nil/empty.

- Add StatusUnknown ("could not check") — Worst() ignores it, so it never
  affects the verdict/exit code.
- isUnreachable(err): a transport/connectivity error (connection refused,
  timeout, DNS, TLS; net.Error/url.Error) that is NOT ErrNoParentRelease and
  NOT an RBAC/NotFound status (those mean the API answered).
- Run() short-circuits on isUnreachable(relErr): emit the one honest
  "Cluster reachable" ✖ and mark the 7 cluster checks StatusUnknown.
  checkBackendEgress still runs (probes the backend from this machine, not the
  cluster API). Display order unchanged. When the API IS reachable, every check
  runs and reports exactly as before (isolated-failure messaging preserved).
- checkReachable names the endpoint ("the cluster API server at <url> isn't
  answering — is the cluster running?") and, for a loopback server, gives the
  local-cluster remedy ("start Docker Desktop, then `k3d cluster start`")
  instead of the kubeconfig/chart remedy.
- doctor renders StatusUnknown as a neutral · line (no ✖/⚠, no remedy).

Verified by TestRun_UnreachableCascade (fake clientset, connection-refused
reactor): one ✖ naming 127.0.0.1:6550 + start-cluster remedy, 7 StatusUnknown
with no remedy, backend egress still ok, Worst()=Fail (exit code unchanged).

Fixes #350. Part of epic tracebloc/backend#1142 (Theme A).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…(Part 1)

The "Service Bus egress (requests-proxy)" check had the direction backwards and
overclaimed its ✔:
- It said a down requests-proxy makes experiments "stay Pending". Wrong path:
  requests-proxy is the OUTBOUND relay (training pods POST epoch results/FLOPs
  → it forwards to Service Bus). Scheduling is a separate inbound path
  jobs-manager consumes directly. A down proxy stalls result/weights egress
  MID-RUN; it does not block scheduling. The old remedy misroutes triage.
- The ✔ is inferred from Deployment ReadyReplicas, but requests-proxy has no
  readiness probe (backend#1143), so "Ready" only means the container started,
  not that Service Bus egress works.

Reword the doc comment + all three lines: missing/not-ready remedies now say
"result egress stalls mid-run (scheduling unaffected)"; the OK detail says
"deployment-ready only; egress not directly probed". Status stays OK on a
healthy install (no new ⚠, exit code unchanged). Name const kept for now.

TestCheckRequestsProxy_Wording locks it: no line says "Pending", and the ✔
admits egress isn't probed.

Part 2 (a real in-cluster Service Bus-egress probe) is deferred — it needs the
requests-proxy /healthz + readiness probe (backend#1143 + a client-runtime
health endpoint) that don't exist yet.

Fixes #351 (Part 1). Part of epic tracebloc/backend#1142.
Stacked on #354 (fix/doctor-reachability-gate) — merge that first.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@LukasWodka LukasWodka self-assigned this Jul 20, 2026
@LukasWodka
LukasWodka requested a review from saadqbal July 20, 2026 12:56
@LukasWodka

Copy link
Copy Markdown
Contributor Author

@BugBot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit c4494cb. Configure here.

@LukasWodka
LukasWodka merged commit ce237a0 into develop Jul 21, 2026
25 checks passed
@LukasWodka
LukasWodka deleted the fix/doctor-requests-proxy-reword branch July 21, 2026 08:00
@LukasWodka

Copy link
Copy Markdown
Contributor Author

/fr-pass — verified live on dev (secure env test0721): doctor --verbose shows the requests-proxy line with result-egress framing and no "Pending" wording; status/exit unchanged on healthy install.

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