Skip to content

feat(BA-8642): add the coordinator client that pushes ingresses to api-delivery workers - #15915

Merged
jopemachine merged 4 commits into
mainfrom
feat/BA-8642-coordinator-worker-client
Oct 20, 2026
Merged

jopemachine merged 4 commits into
mainfrom
feat/BA-8642-coordinator-worker-client

Conversation

@jopemachine

@jopemachine jopemachine commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

📚 Stacked PRs

Part of the AppProxy worker Ingress stack (epic BA-8433). Merge in order (bottom-up):

  1. 👉 this PR — feat(BA-8642): add the coordinator client that pushes ingresses to api-delivery workers ← you are here
  2. feat(BA-8443): push ingresses from the coordinator to api-delivery workers #15833 — feat(BA-8443): push ingresses from the coordinator to api-delivery workers
  3. feat(BA-8444): add the coordinator client that writes ingresses to Traefik etcd #15893 — feat(BA-8444): export ingresses from the coordinator to Traefik etcd

Resolves #15913 (BA-8642)

Summary

  • AppProxyWorkerClient in coordinator/clients/worker/client.py posts IngressUpsertRequest to /v2/ingress/upsert and IngressRemoveRequest to /v2/ingress/remove on one worker's API port (feat(BA-8635): choose how the AppProxy worker receives ingresses #15890), with the API secret in X-BackendAI-Token.
  • AppProxyWorkerClientPool holds one client per worker address. Each client owns its aiohttp.ClientSession, and close() closes them all.
  • Failures, each with the worker address in data, and the worker's status and body when it answered:
    • A 4xx answer → ApiDeliveryWorkerRejectedError (400). Sending the same request again gets the same answer.
    • A 5xx answer → ApiDeliveryWorkerServerError (502).
    • A connection failure → ApiDeliveryWorkerUnreachableError (502).
  • Nothing calls the client yet. feat(BA-8443): push ingresses from the coordinator to api-delivery workers #15833 wires it into the coordinator /v2/ingress API.

Test plan

  • pants check / pants test on tests/unit/appproxy/coordinator/clients/worker::
  • tests/unit/appproxy/coordinator/clients/worker/test_client.py — the API secret is sent, a 4xx answer, a 5xx answer and an unreachable worker each raise their error, the pool reuses the client of an address

🤖 Generated with Claude Code

jopemachine and others added 2 commits October 20, 2026 16:41
…i-delivery workers

ApiDeliveryWorkerClient posts ingress upserts and removals to one
worker's /v2/ingress with the API secret, and ApiDeliveryWorkerClientPool
holds one client per worker address.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the size:L 100~500 LoC label Oct 20, 2026
@github-actions github-actions Bot added the comp:app-proxy Related to App Proxy component label Oct 20, 2026
@jopemachine
jopemachine marked this pull request as ready for review October 20, 2026 07:45
@jopemachine
jopemachine requested a review from a team as a code owner October 20, 2026 07:45
Copilot AI balanced review requested due to automatic review settings October 20, 2026 07:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@jopemachine
jopemachine marked this pull request as draft October 20, 2026 07:47
…swers

A 4xx answer raises ApiDeliveryWorkerRejectedError (400) so the caller
does not retry it, a 5xx raises ApiDeliveryWorkerServerError (502), and
a connection failure raises ApiDeliveryWorkerUnreachableError (502).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jopemachine
jopemachine marked this pull request as ready for review October 20, 2026 07:52
…xyWorkerClient

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jopemachine
jopemachine merged commit 0ef91e0 into main Oct 20, 2026
36 of 37 checks passed
@jopemachine
jopemachine deleted the feat/BA-8642-coordinator-worker-client branch October 20, 2026 08:15
async def close(self) -> None:
for client in self._clients.values():
await client.close()
self._clients.clear()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It looks like they created a separate "pool," but unless it's a health-check-based pool, I don't think it makes much sense. It's also strange that it reads based on the "addr."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:app-proxy Related to App Proxy component size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add the coordinator client that pushes ingresses to api-delivery workers

4 participants