Architecture Decision Record
ADR-025: Startup Warm-Up and Readiness Gating for Cold-Start Mitigation
Status
Accepted (2026-06-27). Revised 2026-07-28: /health/ready now excludes optional-tagged checks as well
as live-tagged ones (see Decision), and the absence of a warm-up timeout was recorded as a known gap
(see Trade-offs). Revised 2026-08-01: that gap is closed. Every warm-up task now runs under a
120-second per-task ceiling, so a task that hangs no longer holds the readiness gate closed (see
Decision and Trade-offs). Revised 2026-08-31: the record now covers SelfHttpWarmupTaskBase, the shipped
base class for warming a host's own inbound request path, which both production apps subclass (see
Decision). Revised 2026-09-02: readiness checks are recorded as PING-class only, never admin-class, and
the framework owns the Redis registration so that the untagged health check an Aspire client integration
adds cannot reach /health/ready (see Context and Decision). Revised 2026-09-19: /health and
/health/ready are served from a short-TTL single-flight report cache (MapCachedHealthChecks over
CachedHealthReportProvider, 5 seconds by default), so an anonymous flood costs one probe round per
window rather than one per request; /alive stays uncached (see Decision). Revised 2026-10-07: anchors
refreshed after the v1.233.0 release. Revised 2026-10-21: the built-in OIDC task is recorded as waking and
JIT-warming the authority's discovery route, not a connection the JwtBearer middleware shares, and the
single-digit-millisecond first-fetch claim is dropped; per-host warm-up anchors refreshed. Revised
2026-10-26: anchors refreshed after the v1.261.0 release. Revised 2026-10-28: the Polly pipeline is
recorded as absorbing a lazy retry on the warming host's own hop only for a dependency called through a
factory-built client (not the JwtBearer backchannel or a missed self-request warm-up, which a caller's
factory-built client sees and retries once for idempotent verbs), and the redis PING check is cited at its
real registration in AddInfrastructureHealthChecks, which adds it only for a connection string named
redis. Revised 2026-11-12: the readiness and liveness semantics recorded here are asserted under a
real dependency outage by the AppHost tier's DependencyOutageTestBase
(ADR-117): a database outage fails /health and
/health/ready, a broker or cache outage fails /health only, and /alive answers 200 at the baseline and at one
read during the outage, without being polled
(MMCA.Common/Source/Hosting/MMCA.Common.Testing.Aspire/Outages/OutageExpectation.cs:18-20,
MMCA.Common/Source/Hosting/MMCA.Common.Testing.Aspire/Outages/DependencyOutageTestBase.cs:105,
:120-127).
Every infrastructure check runs under HealthChecks:CheckTimeoutSeconds (5 seconds by default, 1 to
60), so a dependency that does not answer turns the report unhealthy instead of leaving the last one in
place (Source/Hosting/MMCA.Common.Aspire/Extensions.Health.cs:50-53, default at
Source/Hosting/MMCA.Common.Aspire/Health/HealthReportCacheOptions.cs:55).
Revised 2026-11-23: the outage-test /alive assertion is scoped precisely (the baseline /alive check
is polled until it answers 200; only the during-outage read is a single unpolled read), and anchors
refreshed against current source.
Context
On the Azure Container Apps Consumption plan a replica that has been idle is CPU-throttled, and a scale-from-zero or scaled-out replica starts cold. The first authenticated request on such a replica pays costs that a warm replica does not: DNS resolution, TCP and TLS handshakes, the HTTP connection pool warm-up, and the lazy fetch of the OIDC discovery document by the JwtBearer middleware. That fetch can stretch past the client timeout, which is the textbook "first request fails, second succeeds" symptom. The platform also routes traffic to a replica as soon as its readiness probe passes, so a replica that is technically started but not yet warm gets live traffic it cannot serve cleanly. We need a way to (a) pre-warm the expensive paths before the replica takes traffic and (b) hold the replica out of rotation until that warm-up has had its chance, without letting a single stuck dependency keep a replica permanently out of service.
A readiness probe also fails for reasons that have nothing to do with a dependency being down, and the
command a check chooses is one of them. Aspire's AddRedisClient and AddRedisDistributedCache
register the AspNetCore.HealthChecks.Redis check under the name StackExchange.Redis with no tags at
all, so it is neither live nor optional and lands in /health/ready by construction. Under
StackExchange.Redis 3.x, Azure Managed Redis reports itself as a cluster, so that check issues
CLUSTER INFO, and the client refuses the command on a connection that was not opened in admin mode:
readiness fails on every probe against a cache that is answering normally. That failure takes the worst
shape a deployment failure can take. The new Container Apps revision never activates, the previous
revision keeps serving, and the pipeline reports a successful deploy over a revision that never took a
single request.
Decision
Ship a small warm-up subsystem in MMCA.Common.Aspire, wired into AddServiceDefaults() so every host
gets it.
- A readiness gate that starts closed.
WarmupReadinessGate(singleton) begins not-ready;WarmupReadinessHealthCheckis registered taggedreadyand reportsUnhealthyuntil the gate opens.MapDefaultEndpoints()maps/health/readythroughMapCachedHealthChecks, under a predicate that admits every check tagged neitherlivenoroptional(Source/Hosting/MMCA.Common.Aspire/Extensions.Health.cs:174-176), so while warm-up is running the replica's readiness endpoint reports not-ready and the platform keeps traffic off it. The endpoint is served from a cached health report rather than a probe per request: the helper renders exactly whatMapHealthChecksrenders (the status name astext/plain,503only when unhealthy) but answers fromCachedHealthReportProvider, keyed by path so two endpoints never share a report, and runs the dependency probes at most once per cache window (Extensions.Health.cs:174, helper at:192,Source/Hosting/MMCA.Common.Aspire/Health/CachedHealthReportProvider.cs:52). The window isHealthChecks:CacheSeconds, 5 seconds by default and0to restore probe-per-request behaviour (Source/Hosting/MMCA.Common.Aspire/Health/HealthReportCacheOptions.cs:45, bypass atCachedHealthReportProvider.cs:60), and refreshes are single-flight: a caller that cannot take the refresh slot is served the stale report instead of queueing behind a slow dependency (CachedHealthReportProvider.cs:75). The cache therefore adds up to one window of lag in both directions: readiness can still report not-ready just after the gate opens, and a dependency that has just failed stays invisible to the probe for the same window. (/alivemaps only thelive-tagged self check and is deliberately left uncached,Extensions.Health.cs:158-161, so liveness is unaffected and the container is not restarted.) The second exclusion,optional(HealthCheckTags.cs:32), covers a dependency the app degrades gracefully without: a distributed cache sitting behind an in-memory fallback, a broker behind a retrying outbox. Those checks are still reported on/health, so the degradation stays visible, but they do not gate readiness, because making them readiness-fatal converts a partial degradation into a total outage (every replica goes unready at once and the app stops serving traffic it could still serve). A check is left untagged only when the app genuinely cannot answer correctly without it. - Readiness checks are PING-class, never admin-class. A check that participates in
/health/readymay only issue the cheapest liveness command its dependency offers: a RedisPING, a trivialSELECT 1. It may never issue a command that needs elevated permissions or cluster topology (RedisCLUSTER INFOorCLUSTER NODES, anything that requires admin mode), because such a command reports the caller's privileges as much as the dependency's health, and a probe cannot tell those two answers apart. So MMCA.Common owns the Redis registration for hosts rather than leaving it to each host:AddRedisCachinginMMCA.Common.Aspireregisters the client and the distributed cache with the health checks that the Aspire client integrations add automatically switched off, because those arrive untagged and therefore gate readiness (Source/Hosting/MMCA.Common.Aspire/Caching/RedisCachingExtensions.cs:69, switched off at:76-77). The framework's ownredischeck takes their place, taggedoptionaland performing aPINGonly, but it is registered separately, byAddInfrastructureHealthChecks(Source/Hosting/MMCA.Common.Aspire/Extensions.Health.cs:92-100;Source/Hosting/MMCA.Common.Aspire/Health/RedisPingHealthCheck.cs:27, thePINGat:53), and only when a connection string named exactlyredisis configured (Extensions.Health.cs:83-84).AddRedisCachingaccepts any connection name, so a host that passes a non-default one and configures noredisconnection string gets the cache with no Redis health check at all. When aredisstring is also configured the check exists, butRedisPingHealthCheckpings theIConnectionMultiplexerfrom DI first (RedisPingHealthCheck.cs:48), which is the clientAddRedisCachingregistered under the other name (RedisCachingExtensions.cs:77), so the check is keyed off a different connection string than the one it probes. A host that reaches for an Aspire client integration directly puts the untagged check back and defeats both rules at once. - A background runner that opens the gate once warm-up has had its chance.
WarmupHostedServiceruns every registeredIWarmupTaskexactly once, in parallel, then opens the gate. Critically the gate is opened in afinally, so it opens even if tasks fail: a stuck dependency must not keep a replica out of rotation forever. Each task additionally runs under a 120-second ceiling (TaskTimeoutSeconds,Source/Hosting/MMCA.Common.Aspire/Warmup/WarmupHostedService.cs:42, applied per task as.WaitAsync(_taskTimeout, _timeProvider, cancellationToken)at:69), so a task that neither completes nor throws cannot hold the gate closed either. - Per-task failure is logged, not fatal, and falls back to lazy retry. Each task runs in isolation; a
thrown task is caught and logged at warning level ("will retry lazily on first use",
WarmupHostedService.cs:84-88,:95-97), so the missed warm-up simply happens on the first real request. The Polly pipeline (ADR-009) wraps onlyIHttpClientFactoryclients, since the standard resilience handler is attached throughConfigureHttpClientDefaults(Source/Hosting/MMCA.Common.Aspire/Extensions.cs:57-93), so on the warming host's own hop it covers a lazy retry only for a dependency called through such a client. Neither lazy path on that hop goes through one: the JwtBearer middleware's discovery re-fetch runs over its own default backchannelHttpClient(see the OIDC task below), and a missed self-request warm-up is paid by the first inbound request (aSelfHttpWarmupTaskBasetask builds a plainHttpClientover its ownSocketsHttpHandler,Source/Hosting/MMCA.Common.Aspire/Warmup/SelfHttpWarmupTaskBase.cs:111-112). That inbound request normally arrives from an MMCA caller's factory-built client, such as the UI'sAPIClient(Source/Presentation/MMCA.Common.UI/DependencyInjection.cs:150) or a gRPC typed client with its own resilience handler (Source/Presentation/MMCA.Common.Grpc/DependencyInjection.cs:142), so the caller's pipeline does see a slow first request, whatever its cause, and the standard handler retries it once for idempotent verbs (POST and PATCH are excluded,Extensions.cs:82). A task that trips the 120-second ceiling takes the same route: theTimeoutExceptionis caught and logged at warning level (WarmupHostedService.cs:77-82,:103-105), the abandoned task keeps running detached, and the dependency is retried lazily on first use. The one exception that is rethrown is anOperationCanceledExceptionduring host shutdown, so stopping the host is not mistaken for a task failure. - A built-in task that pre-warms OIDC discovery.
OpenIdConnectMetadataWarmupTaskfetches{Authority}/.well-known/openid-configurationthrough a named client from the sharedIHttpClientFactory(Source/Hosting/MMCA.Common.Aspire/Warmup/OpenIdConnectMetadataWarmupTask.cs:49-50), which wakes and JIT-warms the authority's discovery route (the gateway, or Identity when there is no gateway, as the AppHost wires it atSource/Hosting/MMCA.Common.Aspire.Hosting/Extensions.cs:392-395). The authority keeps no discovery cache to warm: it rebuilds the document from configuration on every request (Source/Presentation/MMCA.Common.API/Startup/Endpoints/OidcDiscoveryEndpointExtensions.cs:56-82). The connection the task opens lives only in its own named-client pool, and nothing else reuses it. It no-ops when noAuthentication:JwtBearer:Authorityis configured (:34-38). The JwtBearer middleware'sConfigurationManagercaches discovery separately and fetches through its own default backchannelHttpClient(noBackchannelorBackchannelHttpHandleris configured anywhere in source), so its first fetch still runs, with its own handshakes over a connection of its own: what it gains is an authority that is already awake, not a shared warm connection (remarks at:14-24). - A shipped base class for warming the host's own request path.
SelfHttpWarmupTaskBase(Source/Hosting/MMCA.Common.Aspire/Warmup/SelfHttpWarmupTaskBase.cs:28, public API atSource/Hosting/MMCA.Common.Aspire/PublicAPI.Shipped.txt:134-136,:140-141,:168,:203-205) is the second warm-up family: where the OIDC task wakes one remote dependency (the authority), this replays a short list of hot read paths against the host's own Kestrel endpoint, so the cost paid down is the full inbound path (ingress connection, Kestrel, output cache, routing, authentication, handler, EF Core, SQL) rather than a single dependency (:11-22). A derived task supplies only a name and itsWarmupPaths(:49,:59); the mechanism is in the base. It waits forApplicationStartedbefore self-requesting, because the warm-up runner starts before Kestrel is listening (:189-199, awaited at:102), and it resolves the actual bound cleartext address fromIServer, falling back toASPNETCORE_URLSand then to port 8080 (:157-166,:39), which is the only correct answer under Aspire's dynamic ports. Requests are pinned to HTTP/2 withRequestVersionExactby default (:70,:77) because a host serving h2c-only cleartext endpoints rejects a silent downgrade to HTTP/1.1, which would fail the warm-up on every startup; a host that stays Http1AndHttp2 overrides both members.RequireSuccessStatusCodedefaults to true but is overridable to false (:90), so a self-request against an[Authorize]route counts as warmed: the 401 is by design and the refusal still traverses the whole pipeline. The task no-ops under theTestingenvironment (:46,:95-98), whose in-memoryTestServernever opens a socket. Failures follow the same rule as the rest of the subsystem: caught, logged at warning level, never fatal (:141-146,:205-207). Both production apps subclass and register it: ADC in Conference (MMCA.ADC/Source/Services/MMCA.ADC.Conference.Service/SelfHttpOutputCacheWarmupTask.cs:22, registered atProgram.cs:286), Engagement (MMCA.ADC/Source/Services/MMCA.ADC.Engagement.Service/SelfHttpWarmupTask.cs:23,Program.cs:114) and Identity (MMCA.ADC/Source/Services/MMCA.ADC.Identity.Service/SelfHttpWarmupTask.cs:25,Program.cs:138); Store in Catalog (MMCA.Store/Source/Services/MMCA.Store.Catalog.Service/SelfHttpOutputCacheWarmupTask.cs:23,Program.cs:89), Identity (MMCA.Store/Source/Services/MMCA.Store.Identity.Service/SelfHttpOutputCacheWarmupTask.cs:25,Program.cs:80) and Sales (MMCA.Store/Source/Services/MMCA.Store.Sales.Service/SelfHttpOutputCacheWarmupTask.cs:26,Program.cs:100). - Extensible per host.
AddWarmupReadiness()registers the gate, the runner, the readiness health check, and the built-in OIDC task; a host adds its own pre-fetches (output cache, reference data) withAddWarmupTask<T>(), which is also how aSelfHttpWarmupTaskBasesubclass enters the run.
Rationale
- Keep cold replicas out of rotation, briefly. Gating readiness on warm-up means the platform does not send a user request to a replica whose registered warm-up tasks have not yet had their chance, which is what turns a cold start into a visible 5xx. It does not cover every first handshake: the JwtBearer middleware's first discovery fetch still opens its own backchannel connection after the gate opens (see the OIDC task above).
- Availability over strict warmth. Opening the gate even when a task fails or hangs is the load-bearing choice: a warm-up that depends on a temporarily unreachable dependency would otherwise pin the replica out of service indefinitely. Falling back to lazy retry trades a possibly-slow first request for guaranteed eventual availability; on the warming host's own hop the resilience pipeline covers that retry only for a dependency called through a factory-built client (not the JwtBearer re-fetch or a missed self-request warm-up), while the caller's factory-built client retries a slow first request once for idempotent verbs.
- Warm the path, not just the cache. The OIDC fetch is the specific cold-start failure we saw; even though the middleware re-fetches over its own connection, waking the authority first means that fetch does not also pay the authority's own cold start. This is the active half of the same cold-start story ADR-004 references from the auth side.
- A readiness probe answers one question. Can this replica serve a request? A cluster-topology or admin-mode command answers a different one, and it answers it wrongly whenever the connection is not privileged, so it can only ever add false negatives to a gate whose false negatives take a replica out of rotation. Holding readiness checks to PING-class commands, and owning the registration in the framework so a host cannot inherit an untagged one by accident, keeps the gate measuring reachability.
- Free for every host, cheap for the ones that do not need it. Putting it in
AddServiceDefaultsmakes it the default posture; the built-in task self-disables when there is no authority, so a host without JwtBearer pays only for the runner and the gate (AddWarmupReadinessis called unconditionally,Source/Hosting/MMCA.Common.Aspire/Extensions.cs:39; see Trade-offs).
Trade-offs
- A replica can enter rotation not fully warm. The gate is opened in a
finallyonce theTask.WhenAllover every registered task returns, that is, once each task has completed, thrown, or timed out (Source/Hosting/MMCA.Common.Aspire/Warmup/WarmupHostedService.cs:53,:58); a thrown or timed-out task is caught and logged rather than retried, so a failed warm-up still admits the replica and its first request pays the lazy cost. Every host-registered task in ADC and Store is aSelfHttpWarmupTaskBasesubclass, whose missed warm-up the warming host's own pipeline does not cover; the mitigation is at the caller hop, where an MMCA caller's factory-built client retries the slow first request once for idempotent verbs (Extensions.cs:82), and it never eliminates the cost. This is deliberate (availability over warmth) but means the gate is a best-effort warm-up signal, not a guarantee. - The per-task ceiling is a backstop, not a latency budget. The gap recorded on 2026-07-28 (an
unbounded
Task.WhenAllwith no per-task deadline anywhere in the subsystem, so a task that HANGS held the readiness gate closed for as long as the host ran) is closed: every task runs under a 120-second ceiling (WarmupHostedService.cs:42, applied at:69), and a task that trips it surfaces as aTimeoutException, is logged, and lets the gate open (:77-82). The number deliberately sits above the 90-second shared Polly total-request timeout that already bounds the built-in OIDC task's HTTP call (Extensions.cs:72,Source/Core/MMCA.Common.Shared/Resilience/HttpResilienceDefaults.cs:21), so a host-registered task doing non-HTTP work, which previously had no bound at all, now inherits the same backstop. Two costs follow. A replica whose warm-up hangs stays out of rotation for the full two minutes before it is admitted, so the ceiling bounds the damage rather than making it cheap. AndWaitAsyncabandons rather than cancels, so the stuck task keeps running detached for the life of the host; the only token that can stop it is still the host'sstoppingTokenat shutdown. - The gate does not surface a broken dependency. Since it opens regardless, a persistently failing warm-up task is visible only in logs and (for dependencies that have their own health checks) through the separate untagged readiness checks, not through the warm-up gate itself.
- A PING-class check is a shallow check.
PINGproves the connection is open and the server is answering; it does not prove the cache can serve the key sizes or the throughput the app needs. That is the trade the rule accepts: a readiness gate reports reachability, and deeper dependency assertions belong on/healthwhere they can be observed without taking a replica out of rotation. - Framework-owned registration costs a hop of indirection. A host that wants an Aspire Redis client
option the framework does not surface has to go through
AddRedisCaching(or extend it) rather than calling the client integration directly, since calling it directly is what re-introduces the untagged check. - Startup work on every host. Every host runs the warm-up runner and the built-in task even if the benefit is marginal (the task no-ops without an authority, but the hosted service and gate still spin up).
- Middleware cache and connection are separate. The warm-up wakes the authority's discovery route,
not the JwtBearer
ConfigurationManager's discovery cache and not its backchannel connection, so the very first authenticated request still triggers the middleware's own fetch over a connection of its own (Source/Hosting/MMCA.Common.Aspire/Warmup/OpenIdConnectMetadataWarmupTask.cs:14-24). How much faster that fetch runs against an already-awake authority is not measured or gated anywhere in the repo.
Revision (2026-10-01)
No decision or rationale changed. Citations were refreshed: the /health/ready predicate, the
MapCachedHealthChecks helper and the uncached /alive mapping now live in
Source/Hosting/MMCA.Common.Aspire/Extensions.Health.cs (:154-156, :170, :138-141); the shared
Polly total-request timeout is assigned at Extensions.cs:53; the SelfHttpWarmupTaskBase public API
starts at PublicAPI.Shipped.txt:129-131; and the per-host AddWarmupTask registrations moved to
ADC Conference Program.cs:308, Engagement :156, Identity :168 and Store Catalog :183, Sales :157.
Revision (2026-10-06)
No decision or rationale changed. The per-host AddWarmupTask registrations moved again and are now
ADC Conference Program.cs:311, Engagement :160, Identity :174 and Store Catalog Program.cs:184,
Identity :145, Sales :158. Anchors were re-verified against current source.
Revision (2026-10-07)
Re-verified against current source. No decision or rationale changed: the readiness gate, the
120-second per-task ceiling, the PING-class rule and the six production SelfHttpWarmupTaskBase
subclasses are as recorded. Only the ADC Conference registration moved.
- Anchors re-verified against current source: ADC Conference
MMCA.ADC/Source/Services/MMCA.ADC.Conference.Service/Program.cs:313(was:311, which the 2026-10-06 revision recorded); unchanged and re-checked: ADC EngagementProgram.cs:160, Identity:174, Store CatalogProgram.cs:184, Identity:145, Sales:158, the six subclass declarations (ADC:22,:23,:23; Store:23,:25,:26),Extensions.Health.cs:154-156andWarmupHostedService.cs:42,:53,:69.
Revision (2026-10-21)
Re-verified against current source. The readiness gate, the 120-second per-task ceiling, the PING-class
rule and the six production SelfHttpWarmupTaskBase subclasses (one AddWarmupTask per host) are
unchanged. What moved is the account of what the built-in OIDC task buys the JwtBearer middleware.
- The OIDC warm-up task no longer records a single-digit-millisecond intent for the middleware's first
fetch, and does not warm a connection the middleware shares. Its remarks
(
Source/Hosting/MMCA.Common.Aspire/Warmup/OpenIdConnectMetadataWarmupTask.cs:14-22) say the middleware fetches through its own default backchannelHttpClient: a warmed authority, not a shared warm connection. What the task actually warms is the authority's discovery route (a wake and JIT warm-up): the authority serves the document from a plainMapGetwith no cache (Source/Presentation/MMCA.Common.API/Startup/Endpoints/OidcDiscoveryEndpointExtensions.cs:60-86), and nothing in source caches DNS, so the remarks' "discovery-doc cache" and "host-level DNS path" are not recorded here. The Decision bullet, the Rationale "Keep cold replicas out", "Warm the path" and "Free for every host" items and the "Middleware cache and connection are separate" trade-off now say so. - Anchors re-verified against current source: ADC Conference
MMCA.ADC/Source/Services/MMCA.ADC.Conference.Service/Program.cs:314(was:313), ADC IdentityProgram.cs:175(was:174), ADC IdentitySelfHttpWarmupTask.cs:25(was:23), Store IdentityProgram.cs:146(was:145), Store SalesProgram.cs:159(was:158),OpenIdConnectMetadataWarmupTask.cs:14-22(was:14-20); unchanged and re-checked: ADC EngagementProgram.cs:160, Store CatalogProgram.cs:184, and the subclass declarations ADC:22,:23, Store:23,:25,:26.
Revision (2026-10-26)
Re-verified against current source. No decision or rationale changed: the readiness gate, the cached
/health/ready predicate, the 120-second per-task ceiling, the PING-class rule, the OIDC task's
behavior and the six production SelfHttpWarmupTaskBase subclasses (one AddWarmupTask per host) are
as recorded. Only anchors moved, and one Trade-offs citation now names the right constant.
- The 90-second total-request timeout citation in Trade-offs pointed at
HttpResilienceDefaults.cs:19, which is nowCircuitBreakerSamplingDuration(60 seconds). It now citesSource/Core/MMCA.Common.Shared/Resilience/HttpResilienceDefaults.cs:22with its full path, since the file lives inMMCA.Common.Shared, notMMCA.Common.Aspire. The value (90 seconds, below the 120-second ceiling) is unchanged. - Anchors re-verified against current source:
Extensions.Health.cs:172(MapCachedHealthChecks, was:170),OpenIdConnectMetadataWarmupTask.cs:49-50(named-client fetch, was:47-48),:34-38(no-authority no-op, was:32-36), remarks:14-24(was:14-22), Aspire.HostingExtensions.cs:345-348(authority wiring, was:344-347), AspireExtensions.cs:37(AddWarmupReadinesscall, was:34) and:64(total-request timeout assignment, was:53),PublicAPI.Shipped.txt:127-129(was:129-131), ADC ConferenceProgram.cs:320(was:314), Engagement:166(was:160), Identity:181(was:175), Store CatalogProgram.cs:190(was:184), Identity:152(was:146), Sales:165(was:159); unchanged and re-checked:Extensions.Health.cs:154-156and:138-141.
Revision (2026-10-28)
Re-verified against current source. The readiness gate, the cached /health/ready predicate, the
120-second per-task ceiling, the PING-class rule, the OIDC task's behavior and the six production
SelfHttpWarmupTaskBase subclasses are unchanged. What moved is the account of what the Polly
pipeline absorbs and where the framework's Redis check is registered.
- The record no longer says every missed warm-up is absorbed by the Polly pipeline. The standard
resilience handler is attached through
ConfigureHttpClientDefaults(Source/Hosting/MMCA.Common.Aspire/Extensions.cs:50-60), so it wraps only factory-built clients. The JwtBearer middleware's lazy discovery re-fetch runs over its own default backchannel (noBackchannelorBackchannelHttpHandleris configured in Common, ADC or Store source), and a missed self-request warm-up is paid by the first inbound request; the task's own client is a plainHttpClient(Source/Hosting/MMCA.Common.Aspire/Warmup/SelfHttpWarmupTaskBase.cs:111-112). That holds for the warming host's own hop only: the first inbound request normally comes from an MMCA caller's factory-built client (the UIAPIClient,Source/Presentation/MMCA.Common.UI/DependencyInjection.cs:132, or a gRPC typed client,Source/Presentation/MMCA.Common.Grpc/DependencyInjection.cs:141), whose pipeline sees the slow request and retries it once for idempotent verbs (POST and PATCH excluded,Extensions.cs:74). The Decision bullet, the Rationale "Availability over strict warmth" item, the first Trade-offs item and the ADR-009 entry in Related now scope the claim to the hop it holds on. - The
redischeck citation pointed atAddRedisCaching(Source/Hosting/MMCA.Common.Aspire/Caching/RedisCachingExtensions.cs:57), which only switches the Aspire checks off (:64-65). TheoptionalPING check is registered byAddInfrastructureHealthChecks(Source/Hosting/MMCA.Common.Aspire/Extensions.Health.cs:84-91), as the class remarks say (RedisCachingExtensions.cs:22-26), and only for a connection string named exactlyredis(Extensions.Health.cs:75), whileAddRedisCachingaccepts any connection name. The Decision bullet now records both: a non-default name with noredisstring leaves the cache with no Redis health check, and a non-default name alongside aredisstring gets a check that pings the DI multiplexer first (Source/Hosting/MMCA.Common.Aspire/Health/RedisPingHealthCheck.cs:47), which is the client registered under the other name (RedisCachingExtensions.cs:65). - Anchors re-verified against current source: ADC Identity
MMCA.ADC/Source/Services/MMCA.ADC.Identity.Service/Program.cs:182(was:181), newWarmupHostedService.cs:84-88and:95-97(failure catch and its log message),RedisPingHealthCheck.cs:52(thePING) and:47(DI multiplexer first),RedisCachingExtensions.cs:65,Extensions.cs:74(POST and PATCH retry exclusion), UIDependencyInjection.cs:132and GrpcDependencyInjection.cs:141; unchanged and re-checked:RedisPingHealthCheck.cs:26,WarmupHostedService.cs:42,:53,:58,:69,:77-82,:103-105.
Revision (2026-11-23)
Re-verified against current source. No decision or rationale changed: the readiness gate, the cached
/health/ready predicate (excluding live and optional), the uncached /alive mapping, the
5-second report cache window, the 120-second per-task ceiling, the 90-second total-request timeout,
the PING-class rule, the OIDC task's behavior and the six production SelfHttpWarmupTaskBase
subclasses (one AddWarmupTask per host) are as recorded. One Status claim is scoped and the anchors
moved.
- The 2026-11-12 Status sentence says
/aliveanswers 200 "at the baseline and at one read during the outage, without being polled". Only the during-outage read is unpolled: it is a singleGetProbeStatusAsynccall asserted once (MMCA.Common/Source/Hosting/MMCA.Common.Testing.Aspire/Outages/DependencyOutageTestBase.cs:121-127). The baseline/alivecheck goes throughAssertProbeEventuallyAsync(:105), which re-probes on an interval until the expected status arrives or its budget runs out (:283, loop at:294-298, the re-probe at:297). - Anchors re-verified against current source:
Extensions.Health.cs:174-176(/health/readypredicate, was:154-156),:174and helper:192(MapCachedHealthChecks, was:172),:158-161(uncached/alive, was:138-141),:83-84(theredisconnection-string gate, was:75),:92-100(theredisregistration, taggedoptionalat:99, was:84-91);HealthReportCacheOptions.cs:45(CacheSeconds = 5,[Range(0, 300)]at:44, was:38) with the zero-window bypass atCachedHealthReportProvider.cs:60;RedisPingHealthCheck.cs:27(was:26),:48(DI multiplexer first, was:47),:53(thePING, was:52);RedisCachingExtensions.cs:69(AddRedisCaching, was:57),:76-77(checks switched off and the client registered, was:64-65and:65); AspireExtensions.cs:57-93(ConfigureHttpClientDefaultsat:57,AddStandardResilienceHandlerat:68, was:50-60),:39(AddWarmupReadiness, was:37),:72(total-request timeout assignment, was:64),:82(POST and PATCH retry exclusion, was:74);HttpResilienceDefaults.cs:21(was:22); UIDependencyInjection.cs:150(was:132) and GrpcDependencyInjection.cs:142(was:141); Aspire.HostingExtensions.cs:392-395(gateway-or-Identity authority wiring insideWithJwksDiscovery, was:345-348);OidcDiscoveryEndpointExtensions.cs:56-82(the uncachedMapGethandler, was:60-86);PublicAPI.Shipped.txt:134-136(was:127-129), with the abstract members at:140-141,DefaultPortat:168and the virtual members at:203-205; ADC ConferenceProgram.cs:286(was:320), Engagement:114(was:166), Identity:138(was:182), Store CatalogProgram.cs:89(was:190), Identity:80(was:152), Sales:100(was:165); unchanged and re-checked:CachedHealthReportProvider.cs:52and:75,HealthReportCacheOptions.cs:55.
Related
ADR-004 (the OIDC discovery document the built-in task pre-fetches, and the auth-side view of the same
cold-start), ADR-009 (the Polly resilience pipeline that absorbs the lazy retry when the gate opens
before a task succeeds: on the warming host's hop for a dependency called through a factory-built
client, and at the caller hop for a slow first inbound request), ADR-019 (the rate limiter that exempts /health and /alive, the endpoints
this gate drives), ADR-026 (the two-tier caching strategy whose Redis substrate the framework-owned
registration and the optional-tagged PING check belong to).