Repository navigation
BCP-148: hold requests while backends become ready - #23
Merged
Merged
Conversation
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.
Authorized requests currently fail immediately when an upstream has no ready endpoints. Add opt-in request waiting so a platform autoscaler can observe pending demand, start the backend, and let the original request proceed once it is connectable.
The gate bounds pending requests and backend cardinality, shares TCP readiness checks, honors cancellation, and tracks active demand through streaming responses. The proxy reauthorizes and mints a fresh assertion after waiting; it never retries a forwarded application request. A validated
tsjwt.dev/backend-wait-timeoutGateway annotation enables the feature, with metrics on the internal operations listener. Existing Gateways retain their current behavior.This is the request-waiting foundation for BCP-148. It does not scale workloads or install a metrics adapter. Deployment adoption must follow the pinned-source release pipeline after native HPA prerequisites and all relevant ingress paths are ready. See
docs/backend-waiting.mdfor the metric contract, readiness assumptions and rollback order.Validation: race tests and vet pass in the core, tsnetid and gateway modules; new tests cover bounded waiting, cancellation, authorization before demand and after waiting, fresh assertions, single POST delivery, concurrent waiters, metric cardinality and streaming demand. No live resources changed.
CI also exposed existing reachable dependency vulnerabilities. Update
klauspost/compressto v1.20.2 andgolang.org/x/netto v0.60.0 in both Tailscale-consuming modules, including their required transitive updates. The patched dependencies raise tsnetid's minimum Go version to 1.26; the core remains Go 1.25 and stdlib-only. CI already uses Go 1.26.