Repository navigation
atenet: add opt-in warm actor route cache - #3823
Draft
Diamond (diamondburned) wants to merge 1 commit into
Draft
Diamond (diamondburned) wants to merge 1 commit into
Diamond (diamondburned) wants to merge 1 commit into
Conversation
Every ingress request through atenet-router currently invokes ResumeActor on ate-api-server even when the target actor is already running on a known worker, turning warm request routing into control-plane RPC and PostgreSQL load. Add an opt-in --warm-route-cache-ttl flag (default 0, Envoy dataplane only) backed by a bounded 65,536-entry LRU cache on ActorResumer. To fence against stale placements and actor recreation under the same name, stamp x-ate-actor-uid on routed requests and verify it in worker atunnel ingress (ignoring unset "-" placeholders during rolling upgrades). When Envoy observes an atunnel 421 with X-Ate-Assignment-Stale: true or an upstream local reply, ext_proc evicts the cached route, marks any concurrent resume flight invalidated so it cannot publish a stale assignment, and rewrites direct-H2 421 responses to 503 Service Unavailable (gRPC UNAVAILABLE).
Diamond (diamondburned)
force-pushed
the
feat/safe-warm-route-cache
branch
from
November 13, 2026 05:08
1981a0d to
fe700e3
Compare
This branch has not been deployed
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.
Summary
Every ingress request routed through atenet-router currently invokes
ResumeActoron ate-api-server even when the target actor is already running on a known worker, turning warm request routing into control-plane RPC and PostgreSQL load.--warm-route-cache-ttlflag (0 by default, Envoy dataplane only) backed by a bounded 65,536-entry LRU cache onActorResumer.x-ate-actor-uidon routed requests and verifies it in worker atunnel ingress (ignoring unset"-"placeholders during rolling upgrades) so stale cached routes cannot cross into a recreated actor sharing the same(atespace, name).ResponseHeadersinspection when--warm-route-cache-ttl > 0: when atunnel responds with HTTP 421 (X-Ate-Assignment-Stale: truein direct H2 mode) or Envoy generates a local reply (includingCONNECTtunnel rejections and upstream connection failures), Envoy's external processor evicts the cached route, marks any concurrentResumeActorflight invalidated so it cannot publish a stale placement, and rewrites direct-H2 421 responses to 503 Service Unavailable (codes.Unavailablefor gRPC callers). Application 404/5xx responses from inside the actor lackX-Ate-Assignment-Staleand do not evict the cache.Verification
go test -race -count=3 -shuffle=on ./internal/atenet/... ./internal/atunnel/... ./cmd/atenet/..../hack/verify/boilerplate.sh && ./hack/verify/gofmt.sh && ./hack/verify/package-deps.sh🤖 PR was made with the use of generative AI.