Repository navigation
Conversation
… backend
Operators had no way to stop customer diagnostics without restarting the gateway, and a restart starts the 125 s recovery hold that refuses every operator and FabricQuery probe in the cell. The admission rates and caps were fixed at the contract's defaults, nothing reported throttling, limiter health or service outcomes, no alert covered them, and the node permit and aggregate budget flags existed only as manual steps in the docs. Nothing checked the clock that every deadline and permit bound depends on.
The gateway's --service-config-map names a ConfigMap whose key "service" turns execution on ("enabled") or off while it runs. Each replica reads it uncached every second; a missing ConfigMap or key, a failed read and any other value mean off. Turning it off refuses new RunDiagnostic calls with ServiceDisabled and cancels running requests through their context within 2 s: their routers report Cancelled and the stream ends with complete reason Cancelled. It leaves the limiter, its election and operator and FabricQuery work untouched, so no recovery hold starts. The gateway refuses the flag without --aggregate-budgets.
New gateway flags expose every admission rate, burst and cap. Limits.Qualified refuses any value above the contract default, which stays the ceiling until a contract revision qualifies more, and the gateway refuses to start on a limit flag without --aggregate-budgets, a raised value or limits that break a cross-field rule.
limit.KernelClock reads the clock discipline with adjtimex. While the kernel reports its clock unsynchronised, or its maximum error above 500 ms, the leader's authority refuses with LimiterUnavailable and cancels the epoch's work like a failed Lease read, starting a new hold once the clock recovers, and a node refuses every probe permit.
The gateway now exports service requests by operation and reason, router outcomes and omissions, request duration, admission refusals by traffic class, limiter scope and reason, charged packets by traffic class, the switch's state, live streams, limiter state and key counts, and clock health; the node exports permit decisions by outcome and its clock health. Labels come from fixed sets: no project, request or service ID, node name or target is a label. The leader logs one line per request it ran with attribution and coverage counts, never targets, results or node error text. A test runs requests and throttling and checks the registry and the logs for each.
The fabric-api rule group gains FabricAPILimiterUnavailable, FabricAPIClockUnsynchronized, FabricAPIServiceThrottled and FabricAPIServiceExecutionFailing, each unit-tested with promtool, including idle and disabled cells that must not fire.
Four opt-in Kustomize Components package the rollout: fabric-api-permits and fabric-api-require-permits for the fabric-router sidecar, aggregate-budgets and service for the gateway. Each fails its build without the Component it needs. The service Component's ConfigMap ships disabled and carries Flux's ssa IfNotPresent annotation, so an operator's kubectl stop survives reconciliation. task test:manifests renders each composition and each invalid one, and a new CI job runs it. configuration.md documents the switch and what happens to active work, the limit flags with tuning guidance and failure bounds, diagnosis from the new metrics, and the upgrade and rollback order.
Fixes #1047
The clock check compared the kernel's maximum error with the 500 ms bound. That figure grows by 500 µs every second between the time daemon's updates, and chrony spaces them up to about 17 minutes apart, so a healthy host crossed the bound before each update and the leader dropped its limiter into a fresh 125 s hold. A host measured at a 1034 s update interval reported 148 ms of maximum error against 2 ms of estimated error. The check now uses the estimated error; an unsynchronised clock still fails, and the kernel marks a clock unsynchronised itself once the maximum error reaches 16 s. The adjtimex read is allowed by the default containerd and Docker seccomp profiles with every capability dropped, which the doc comment now says. The service switch no longer warns about an unreadable ConfigMap when the gateway shuts down, the request duration metric's help names its actual start and scope, and the docs say a disable takes effect once a replica reads it, within a second.
Contributor
Author
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
Operators had no way to stop customer Looking Glass diagnostics without restarting the gateway, which also pauses every operator and FabricQuery probe in the cell for two minutes.
A ConfigMap switch now turns customer execution on or off while the gateway runs, cancelling running requests within 2 seconds and leaving routing, operator and FabricQuery work alone. Admission limits become flags that can only lower the contract's defaults, the leader and nodes refuse work while the kernel clock is unsynchronised, and new metrics, four alerts and opt-in Kustomize Components cover throttling, limiter health and the rollout order.
Everything ships off: a cell runs customer diagnostics only after an operator applies the Components and flips the switch.
Test plan
Fixes #1047