Skip to content

fix(backend): avoid transport dependency in replica classification - #599

Merged
timtofan merged 1 commit into
masterfrom
atimofieiev/http-status-interface
Nov 14, 2026
Merged

timtofan merged 1 commit into
masterfrom
atimofieiev/http-status-interface

Conversation

@timtofan

Copy link
Copy Markdown
Collaborator

Why

The full test suite cannot compile after #598: replica classification imports the concrete network transport, whose internal routing tests import the backend package. This import cycle prevents a normal tested release.

Architecture

Expose HTTPStatusCode() on the existing transport error and classify it through a small interface with errors.As. The backend orchestration layer no longer imports its transport implementation. Wrapped HTTP 503 errors retain the recovery behavior introduced in #598; all other status and timeout rules are unchanged.

Before / after

Before After
Backend classification depends on the concrete network error type; network package tests form an import cycle. Classification reads the status through an interface; both package test suites compile.
Replica 503 recovery requires the concrete transport dependency. The existing transport error supplies the status method at the same call site.

Validation

  • Go 1.27 build and vet pass for backend, backend/net and app/carbonapi.
  • Tests pass for all three packages, including replica recovery, wrapped 503, negative cases and network routing tests.
  • The full release test gate will run again before deployment; no test is bypassed.

@timtofan
timtofan merged commit 22b76c5 into master Nov 14, 2026
5 checks passed
@timtofan
timtofan deleted the atimofieiev/http-status-interface branch November 14, 2026 18:22
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.

1 participant