Repository navigation
feat(BA-8642): add the coordinator client that pushes ingresses to api-delivery workers - #15915
Merged
Merged
Conversation
…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>
This was referenced Oct 20, 2026
jopemachine
marked this pull request as ready for review
October 20, 2026 07:45
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
marked this pull request as ready for review
October 20, 2026 07:52
…xyWorkerClient Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
seedspirit
approved these changes
Oct 20, 2026
HyeockJinKim
requested changes
Oct 20, 2026
| async def close(self) -> None: | ||
| for client in self._clients.values(): | ||
| await client.close() | ||
| self._clients.clear() |
Collaborator
There was a problem hiding this comment.
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."
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📚 Stacked PRs
Part of the AppProxy worker Ingress stack (epic BA-8433). Merge in order (bottom-up):
feat(BA-8642): add the coordinator client that pushes ingresses to api-delivery workers ← you are herefeat(BA-8443): push ingresses from the coordinator to api-delivery workersfeat(BA-8444): export ingresses from the coordinator to Traefik etcdResolves #15913 (BA-8642)
Summary
AppProxyWorkerClientincoordinator/clients/worker/client.pypostsIngressUpsertRequestto/v2/ingress/upsertandIngressRemoveRequestto/v2/ingress/removeon one worker's API port (feat(BA-8635): choose how the AppProxy worker receives ingresses #15890), with the API secret inX-BackendAI-Token.AppProxyWorkerClientPoolholds one client per worker address. Each client owns itsaiohttp.ClientSession, andclose()closes them all.data, and the worker's status and body when it answered:ApiDeliveryWorkerRejectedError(400). Sending the same request again gets the same answer.ApiDeliveryWorkerServerError(502).ApiDeliveryWorkerUnreachableError(502)./v2/ingressAPI.Test plan
pants check/pants testontests/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