Architecture Decision Record
ADR-009: Resilience Policies & Recovery Objectives
Status
Accepted (2026-06-14). Amended by ADR-087 (2026-08-18): the resilience objective extends past outbound HTTP and gRPC clients for the first time, to the outbox's broker publish, which gains a circuit breaker. The database posture is deliberately unchanged and a per-query database breaker is recorded as rejected. See the Revision (2026-08-18) below.
Revised 2026-09-11 (two amendments: the standard handler's runtime behaviour is observable for the
first time, through the Polly meter the Aspire defaults now subscribe
(ADR-041); and Smtp:TimeoutSeconds bounds the framework's
SMTP client, which is not an HttpClient. See the Revision (2026-09-11) at the end.)
Revised 2026-09-19 (the consumer-side companion the 2026-09-11 revision described as intended but
absent is now in MMCA.Store's main: the Stripe leg has one retry owner. See the Revision
(2026-09-19) at the end.)
Revised 2026-10-01 (current-state sections realigned with the code; no decision change. See the Revision (2026-10-01) at the end.)
Revised 2026-10-06: the DR-doc acceptance is described as written rather than signed off, the
example consumer and the drill-table mitigation now match MMCA.Store and the dr-freshness gates,
and the Stripe retry predicate also treats a client timeout as transient. See the Revision
(2026-10-06) at the end.
Revised 2026-10-07: anchors refreshed after the v1.233.0 release.
Revised 2026-10-21: the gRPC retry predicate is stated as before-send connection failures only, the outbox breaker is recorded as also wrapping in-process integration handlers on a monolith, and the database posture is recorded for PostgreSQL as well as SQL Server.
Revised 2026-10-23: the east-west gRPC values moved into HttpResilienceDefaults (Grpc-prefixed)
with their own 8s/20s timeouts instead of the outbound-HTTP 30s/90s, AddTypedGrpcClient gained a
per-client override, and the ResilienceHandlerTests anchors are refreshed.
Revised 2026-10-26: AddTypedServiceClient and its registration test are gone (removed in
v1.254.0), so the HTTP half of Decision point 1 now rests on the global Aspire
ConfigureHttpClientDefaults handler alone; other anchors refreshed.
Revised 2026-10-28: anchors refreshed after the v1.265.1 release.
Revised 2026-11-12: Decision point 1 names the two factory-created clients deliberately outside the standard handler (the outbound webhook client and the gateway's downstream health-probe client) and no longer counts the YARP forwarder among the factory-created clients, and the infrastructure health checks, the gateway's opt-in connect-failure retry and the executable outage tier are recorded. See the Revision (2026-11-12) at the end.
Revised 2026-11-23: the YARP forwarder client is built by YARP's stock factory unless the gateway retry is enabled, Store's Stripe pipeline is its own class shared by the payment service and the tax calculator, and the RabbitMQ check's rationale names the framework's own check rather than a package; other anchors refreshed. See the Revision (2026-11-23) at the end.
Revised 2026-12-02: only point-in-time restore is drilled, and the owner accepts that geo-restore and
long-term-retention restore are not, so the 4 h region-loss RTO is a planning figure; both
dr-freshness gates key a failed drill to its database; and ADC's recent drill restores are recorded
against the 1 h single-database RTO. See the Revision (2026-12-02) at the end.
Context
The framework already supplies the mechanisms for surviving partial failure: a standard Polly resilience handler (timeout / retry / circuit breaker), the outbox for at-least-once delivery (ADR-003), and database-per-service isolation (ADR-006). What was missing was a stated contract:
- No guaranteed coverage. Resilience is applied per registration site (
AddTypedGrpcClient) plus a globalConfigureHttpClientDefaultsdefault inMMCA.Common.Aspire. Nothing stopped a new outbound client from silently shipping with no retry/circuit-breaker. - No recovery objectives. Each consumer deploys its own databases, but RTO/RPO and the single-region-vs-failover decision were undocumented: "we'd figure it out" is not a plan, and an untested backup is not a backup (rubric §29).
Decision
- Resilience is a framework invariant, not a per-call choice. Every outbound
HttpClientcreated throughIHttpClientFactoryin a host that callsAddServiceDefaults(typed clients, named clients), and every gRPC client registered throughAddTypedGrpcClient, wires the standard resilience handler. A client constructed by hand withnew HttpClient(...)is outside this default and owns its own bounds, and so is the YARP forwarder's client, which YARP's own forwarder client factory builds: YARP's stock factory by default, replaced by the framework's subclass of it (MMCA.Common/Source/Hosting/MMCA.Common.Gateway/Forwarding/GatewayRetryForwarderHttpClientFactory.cs:12) only whenMmcaGateway:Retry:Enabledis set (MMCA.Common/Source/Hosting/MMCA.Common.Gateway/GatewayReverseProxyExtensions.cs:108-110); ADR-088 records no Polly pipeline on that hop. Two factory-created clients are outside it on purpose. The outbound webhook client clears every additional handler a host default adds, the resilience pipeline included (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Webhooks/WebhookServiceCollectionExtensions.cs:101, reasoning at:48-50), because its retries are the internal-command attempts of the webhook delivery lane rather than Polly retries, and it is bounded by its ownWebhooks:TimeoutSeconds(:87-88); ADR-142 owns the lane's rules. The gateway's downstream health-probe client removes every resilience handler, because a retry inside its probe budget would turn a healthy downstream into a timed-out one (MMCA.Common/Source/Hosting/MMCA.Common.Aspire/Gateway/GatewayHealthCheckExtensions.cs:190,:204-221). The HTTP default is the globalConfigureHttpClientDefaultsregistration (MMCA.Common/Source/Hosting/MMCA.Common.Aspire/Extensions.cs:57-116, scoped by its comment at:54-56, the handler at:68-93), which takes its timeouts, retry budget and sampling window fromHttpResilienceDefaults(:70-73) and switches the retry off for POST and PATCH (:82). The framework no longer ships a typed HTTP service-client helper:AddTypedServiceClientwas removed in v1.254.0, gRPC throughAddTypedGrpcClientis the supported cross-service client, and a host that wants a typedHttpClientregisters it itself (MMCA.Common/CHANGELOG.md:1130).AddTypedGrpcClientreads theGrpc-prefixed members of the sameHttpResilienceDefaults(MMCA.Common/Source/Presentation/MMCA.Common.Grpc/DependencyInjection.cs:142-168). Its timeouts are the east-west path's own, not the outbound-HTTP 30s/90s: an 8-second attempt and a 20-second total, about ten times the slowest measured east-west gRPC p99 of 784 ms (MMCA.Common/Source/Core/MMCA.Common.Shared/Resilience/HttpResilienceDefaults.cs:67-75). It shares the HTTP path's retry budget and breaker sampling window (:32,:18), states its own breaker shape (:77-93), and retries only a failure to reach the peer before the request was sent: anHttpRequestExceptionwhoseHttpRequestErroris a name-resolution, connect or TLS handshake failure (DependencyInjection.cs:155-160). An optional per-clientconfigureResiliencecallback runs after those defaults, so it wins only where it sets a value (:92-97,:166-167). This is enforced by fitness functions on both halves (ResilienceHandlerTestsinMMCA.Common.Grpc.Testsfor gRPC,ServiceDefaultsRetryTestsinMMCA.Common.Aspire.Testsfor the HTTP default) so the policy cannot silently regress. - Consumers must declare recovery objectives. Each consuming app documents, in its own
infra/DISASTER-RECOVERY.md: RTO/RPO per failure scenario, the backup/restore mechanism, and an explicit, written acceptance of single-region risk (or a multi-region failover plan). A restore must be drilled: the DR doc carries a drill-result table that cannot stay empty. - Graceful degradation is the default posture. When a synchronous dependency is unreachable, the resilience pipeline retries/breaks; cross-service consistency that can be deferred flows through the outbox (ADR-003), which buffers and guarantees eventual delivery after recovery.
Reference objectives (MMCA.ADC: a regional, non-24×7 conference app)
| Scenario | RPO | RTO |
|---|---|---|
| Accidental data loss / bad migration (within retention) | ≤ ~10 min (continuous PITR) | ≤ 2 h |
| Single service DB corruption | ≤ ~10 min | ≤ 1 h (PITR restore-as-new, swap) |
| Full region loss | ≤ 1 h (geo-redundant backup) | ≤ 4 h (geo-restore + redeploy) |
ADC deliberately accepts single-region risk: sub-hour multi-region failover is not worth the
cost/complexity at its scale. MMCA.Store, the other consumer, records the same objectives and the
same accepted single-region risk in its own DR doc (MMCA.Store/infra/DISASTER-RECOVERY.md:10-15).
A consumer with stricter availability needs would set tighter objectives and a failover plan in its
own DR doc: the framework does not mandate one set of numbers, only that the numbers exist and the
restore is drilled.
Rationale
- Invariant over discipline. A fitness function turns "remember to add resilience" into a build gate: the same approach the framework already uses for the layer rules and the MassTransit-v8 pin.
- Objectives belong to the deployer. RTO/RPO depend on the data and the business, which the framework can't know; it can only require that consumers decide and record them.
- Drilled, not assumed. The single most common DR failure is discovering at 2 a.m. that the backups never restored. Forcing a recorded drill closes the §29 gap that documentation alone leaves.
Trade-offs
- The named gate (
ResilienceHandlerTests,MMCA.Common.Grpc.Tests) asserts every option the gRPC client path (AddTypedGrpcClient) configures (MMCA.Common/Tests/Presentation/MMCA.Common.Grpc.Tests/ResilienceHandlerTests.cs:53-77), proves the per-client override runs after the defaults and that omitting it keeps them (:80-112), pins theGrpc-prefixedHttpResilienceDefaultsvalues (:176-185), asserts the gRPC timeouts stay tighter than the HTTP ones while leaving room for both attempts (:188-195) and that the configured options pass the library's sampling-window validation (:199-211), and checks the retry predicate at runtime (:116-131), with a theory proving that only the three before-sendHttpRequestErrorvalues are retried (:134-158). Choosing the values is still a review concern; a silent change to them is not. A separate fault-injection test (ResilienceCircuitBreakerFaultInjectionTests, same project) drives sustained failures and proves the circuit breaker actually trips and short-circuits. The global HTTP default has its own runtime gate (ServiceDefaultsRetryTests,MMCA.Common/Tests/Hosting/MMCA.Common.Aspire.Tests/Resilience/ServiceDefaultsRetryTests.cs): on a 503 only the idempotent verbs are retried (:33), a POST is not replayed after an attempt timeout (:46), and a 429 is retried only within theRetry-Afterbudget (:65,:77). - Per-consumer DR docs can drift from reality. The drill-result table is hand-maintained and lags the
drills (its last rows are 2026-08-10 in
MMCA.ADC/infra/DISASTER-RECOVERY.md:204and 2026-07-28 inMMCA.Store/infra/DISASTER-RECOVERY.md:216-218), so it is not the operative mitigation: drill recency is enforced fromdr-drill.ymlrun history by each consumer'sdr-freshnessdeploy gate (MMCA.ADC/.github/workflows/deploy.yml:1242-1254,MMCA.Store/.github/workflows/deploy.yml:1005-1016). - A gRPC client that needs bespoke timeouts passes
AddTypedGrpcClient'sconfigureResiliencecallback, which adjusts the standard handler after the defaults (MMCA.Common/Source/Presentation/MMCA.Common.Grpc/DependencyInjection.cs:92-97,:167); there is still no switch that opts the client out of resilience entirely: intentional friction.
Revision (2026-08-18)
This record's first Decision point scoped resilience to "every outbound HttpClient and gRPC client
registered through the framework's extension methods". That scope was accurate and it was also the
whole story: no other dependency in the framework had a resilience policy of any kind. Two changes,
both recorded in full in ADR-087.
- The outbox's broker publish is now a resilience objective.
OutboxProcessorholds a PollyResiliencePipeline(MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Persistence/Outbox/Processing/OutboxProcessor.cs:101, built at:757-768) and wraps exactly one call in it, the broker publish (:598-602); the in-process dispatch branch (:604-607) and every database call sit outside it by construction (:89-92). Its parameters live beside the HTTP ones asBrokerResilienceDefaults(MMCA.Common/Source/Core/MMCA.Common.Shared/Resilience/BrokerResilienceDefaults.cs:24: a 0.5 failure ratio over a 30-second sampling window, a minimum throughput of 10, and a 15-second break), which is the same shapeHttpResilienceDefaultsalready had. It is a breaker with no retry paired with it (:17-22), because the outbox loop already is the retry, andBrokenCircuitExceptionis fed into the ordinary failure path so a short-circuited publish re-leases and eventually dead-letters exactly like any other failed one. What it buys is failing in microseconds instead of a connection timeout during a broker outage, and one log line per batch instead of one per message. - A per-query database circuit breaker was evaluated and rejected. It is not a gap and it is not
scheduled. EF Core's
EnableRetryOnFailureexecution strategy (.../Persistence/DbContexts/SQLServerDbContext.cs:63-66, five retries with a ten-second maximum delay, alongsideCommandTimeoutSecondsat:55) already owns retrying at the persistence layer and constrains how a user-initiated transaction may be written (:60-62, restated at.../Application/Interfaces/Infrastructure/Persistence/IUnitOfWork.cs:60-69), which is why the strategy is materialized explicitly inDbContextFactory(:525). A Polly breaker wrapped around a call the strategy is already retrying would either count one logical failure many times or force the strategy to be replaced, and replacing it is an EF execution-strategy rework rather than a resilience addition. The EF retry strategy plus the command timeout remains the database resilience posture, and the asymmetry with the broker leg is therefore a decision rather than an oversight.
The Decision's second and third points are untouched: consumers still declare RTO/RPO with a drilled restore, and graceful degradation is still the default posture. The first point should now be read as "every outbound client, plus the outbox broker publish". One thing this revision does not change is the Trade-offs entry above about test coverage: the breaker's parameters are asserted nowhere, so like the HTTP handler it is registration and review that carry them, and the broker breaker has no equivalent of the gRPC fault-injection test.
Revision (2026-09-11)
Two amendments, both about parts of this posture the record could not previously see or reach.
(a) The standard handler is now observable. Decision point 1 makes the resilience handler an
invariant, and the Trade-offs note that the named gate asserts registration rather than runtime
behaviour. Until now the runtime behaviour was also invisible in production: the handler is wired for
every HttpClient and every gRPC typed client
(MMCA.Common/Source/Hosting/MMCA.Common.Aspire/Extensions.cs:83, :93-:98, values from
HttpResilienceDefaults), but the meter Polly emits through was never subscribed, so a retry storm or
an open circuit left the process as nothing but latency. AddServiceDefaults now subscribes the
Polly meter (Extensions.cs:596, the literal at :49), which makes
resilience.polly.strategy.events (:57) the operational signal for this record's Decision:
OnRetry, OnCircuitOpened, OnCircuitClosed and OnTimeout, tagged by pipeline and strategy.
Polly's two duration histograms stay dropped unless a host sets
Telemetry:EnablePollyDurationMetrics=true (:598-:610), because they re-measure what the
HttpClient request duration already reports.
ADR-041 carries the detail; what belongs here is that
"resilience is a framework invariant" is now checkable at runtime and not only at registration.
(b) The one outbound client the handler does not cover is now bounded. SmtpEmailSender builds a
System.Net.Mail.SmtpClient per send. It is not an HttpClient, so it never saw the standard handler
and it sat at the .NET default timeout of 100 seconds, which is longer than any caller in front of it
is willing to wait: a relay that accepts the TCP connection and then stops answering held a request
thread for the full 100 seconds, one per message in a notification burst. SmtpSettings.TimeoutSeconds
(MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Mail/SmtpSettings.cs:59, [Range(1, 600)] at
:58, default 30) is applied to the per-send client
(MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Mail/SmtpEmailSender.cs:107). It is validated
with the rest of the Smtp section at startup
(ADR-070), so a zero or a typo is a startup failure rather
than either an instant abort or an unbounded wait. This is a bound, not a retry policy: redelivery
stays with the outbox and the notification pipeline.
The consumer-side companion: one retry owner per outbound dependency. The same reasoning reaches an
SDK-owned client in a consuming app, where the SDK ships its own retry loop and the consumer has
already built one. MMCA.Store's Stripe integration is the live example. StripePaymentService builds
an explicit Polly pipeline, a retry with exponential backoff over transient StripeException and raw
HttpRequestException, then a circuit breaker
(MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripePaymentService.cs:69-:95,
attempts and delay from
MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripeSettings.cs:40,
:44), while the SDK client underneath is constructed with nothing but the secret key
(MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripeClientFactory.cs:20),
which leaves Stripe.net's own network retries and its own timeout at their defaults underneath a
pipeline that already retries. The intended shape is one retry owner: zero SDK retries and an explicit
SDK timeout, with Store's pipeline doing the retrying. That configuration is not in MMCA.Store's
main as this revision is written; the framework half, the meter and the SMTP bound, is what this
record can currently claim.
Revision (2026-09-19)
That consumer-side companion is now in MMCA.Store's main. StripeClientFactory builds the SDK
client over an explicitly bounded HTTP stack instead of Stripe.net's defaults, and both halves the
2026-09-11 revision asked for are present: the StripeClient is given a SystemNetHttpClient
constructed with maxNetworkRetries: 0
(MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripeClientFactory.cs:48-:50),
and the HttpClient underneath it carries an explicit
Timeout of StripeSettings.RequestTimeoutSeconds (:43-:46; the setting at
.../Payments/Stripe/StripeSettings.cs:44, [Range(1, 120)] at :43, default 30 seconds).
Both are required together: zero SDK retries on their own would still leave each attempt on the
SDK's own per-attempt budget, which the factory's own note records as 80 seconds (:11-:18).
StripePaymentService's Polly pipeline, the retry with exponential backoff followed by the circuit
breaker (.../Payments/Stripe/StripePaymentService.cs:69-:95), is therefore the single retry
owner for this dependency, which is what Decision point 1 asks of a framework-registered client and
what an SDK-owned client has to be configured into by hand. The breaker also now counts what its
settings say it counts: one network attempt per recorded failure, rather than a call that had
already spent three attempts inside the SDK.
Unlike the framework-side half, this one has a unit gate rather than review alone:
StripeClientFactoryTests.Create_BuildsAClientWhoseHttpClientPerformsNoRetriesOfItsOwn
(MMCA.Store/Tests/Modules/Sales/MMCA.Store.Sales.Infrastructure.Tests/Services/StripeClientFactoryTests.cs:17-:25)
asserts MaxNetworkRetries is 0 on the client the factory hands out, so a return to the SDK default
fails a test. The timeout value itself is not asserted, only bounded by configuration validation, so
the Trade-offs entry about parameters being a review concern still holds for it. This revision
changes nothing else: the Decision's three points, the reference objectives, and the database
posture recorded on 2026-08-18 all stand as written.
Revision (2026-10-01)
No decision or rationale changes; the current-state sections are brought back in line with the code.
Decision point 1 no longer says the gRPC client matches the global HTTP defaults outright: at that
date it read a separate gRPC defaults class
(MMCA.Common/Source/Presentation/MMCA.Common.Grpc/DependencyInjection.cs:127-142), which then shared
the HTTP timeouts and retry budget (both since superseded: see the 2026-10-23 status line) but set an
explicit breaker (a 0.5 failure ratio, a minimum throughput of 10 and a 10-second break, :27-33)
because an east-west call bypasses the Gateway's health checks, and retries only an
HttpRequestException (DependencyInjection.cs:137) because every gRPC call is a POST. The
Trade-offs entry about test coverage is corrected: ResilienceHandlerTests now asserts and pins the
policy values rather than registration alone
(MMCA.Common/Tests/Presentation/MMCA.Common.Grpc.Tests/ResilienceHandlerTests.cs:53-133), and
AddTypedServiceClient has its registration test
(MMCA.Common/Tests/Core/MMCA.Common.Infrastructure.Tests/Messaging/TypedServiceClientRegistrationTests.cs:15-28).
The broker breaker also has a fault-injection test now, which the 2026-08-18 revision records as
absent
(MMCA.Common/Tests/Core/MMCA.Common.Infrastructure.Tests/Persistence/Outbox/Processing/OutboxProcessorTests.cs:667).
The Status line about SMTP no longer calls it the one framework outbound client outside the standard
handler: the optional AI provider adapters build SDK-owned clients, bounded by Ai timeout settings
(MMCA.Common/Source/Core/MMCA.Common.AI.Anthropic/AnthropicAiProviderFactory.cs:37-48,
MMCA.Common/Source/Core/MMCA.Common.AI.OpenAI/OpenAiProviderFactory.cs:42-49), with the SDKs' own
retry counts left at their defaults. Citations inside the earlier Revision sections are left as
recorded.
Revision (2026-10-06)
No decision changes; the current-state sections are brought back in line with the code and the consumer DR docs.
- Decision point 2 no longer calls the single-region acceptance "signed-off": both DR docs state it
in writing (
MMCA.ADC/infra/DISASTER-RECOVERY.md:23,MMCA.Store/infra/DISASTER-RECOVERY.md:23) but neither records an approver or a sign-off. - The "24x7 store" example is replaced: MMCA.Store, the real second consumer, uses the same objectives
and calls itself non-24x7-critical (
MMCA.Store/infra/DISASTER-RECOVERY.md:10-15). - The Trade-offs entry about DR-doc drift no longer names the drill-result table as the mitigation:
both tables lag the drills, and recency is enforced by the
dr-freshnessdeploy gate overdr-drill.ymlrun history. - Decision point 1 records that
AddTypedServiceClientdisables the retry for POST and PATCH (DependencyInjection.Messaging.cs:177), and the Trade-offs entry records the theory that tests it. - The Stripe pipeline the 2026-09-11 and 2026-09-19 revisions describe now also treats an
OperationCanceledExceptionas transient when the caller's token is not cancelled (anHttpClienttimeout): retry and breaker shareIsTransientFailure(MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripePaymentService.cs:557-564, the timeout arm at:562). The pipeline itself is at:76-113, and the attempts and delay come fromStripeSettings.cs:64and:68(defaults 3 and 500 ms). - Current locations of facts recorded in earlier revisions: the outbox broker pipeline field at
OutboxProcessor.cs:102, built at:698-709, wrapping the publish at:548-552with the in-process branch at:554-558; the execution-strategy note atIUnitOfWork.cs:47-52andExecuteInTransactionAsyncat:63-65;CreateExecutionStrategy()atDbContextFactory.cs:576; the global handler atMMCA.Common/Source/Hosting/MMCA.Common.Aspire/Extensions.cs:49-62insideConfigureHttpClientDefaults(:39-85), which also reaches gRPC clients, with the gRPC-specific handler layered on top (MMCA.Common/Source/Presentation/MMCA.Common.Grpc/DependencyInjection.cs:102-104,:127-142); and the Polly meter wiring inExtensions.Telemetry.cs(meter name:31,resilience.polly.strategy.events:52,AddMeter:322, the duration-histogram opt-in:332, config key:25). - Anchors in the live sections were re-verified against current source.
Revision (2026-10-07)
Re-verified against current source. No decision, default or rationale changes: the outbox broker
breaker, the Stripe single-retry-owner pipeline, the Polly meter wiring and both consumers'
dr-freshness gates all behave as recorded. Only line positions moved, after the v1.233.0 release,
including several the 2026-10-06 revision listed as current.
- Anchors re-verified against current source: the Trade-offs
dr-freshnessgates now atMMCA.ADC/.github/workflows/deploy.yml:830-839andMMCA.Store/.github/workflows/deploy.yml:788-796(both overdr-drill.ymlwith an 8-day window,:838-839and:795-796); the outbox broker pipeline field atMMCA.Common/Source/Core/MMCA.Common.Infrastructure/Persistence/Outbox/Processing/OutboxProcessor.cs:105, built byBuildBrokerPublishPipelineat:868-879, wrapping the broker publish at:685-689with the in-process dispatch branch outside it at:691-695, andBrokenCircuitExceptionrecognized in the ordinary failure path at:554; the broker breaker's fault-injection test atMMCA.Common/Tests/Core/MMCA.Common.Infrastructure.Tests/Persistence/Outbox/Processing/OutboxProcessorTests.cs:665; the Stripe pipeline atMMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripePaymentService.cs:76-113(retry:77, breaker:94, sharedIsTransientFailureat:557), withRetryMaxAttemptsandRetryDelayMsat.../Payments/Stripe/StripeSettings.cs:64and:68andRequestTimeoutSecondsat:44; and the Polly meter wiring inMMCA.Common/Source/Hosting/MMCA.Common.Aspire/Extensions.Telemetry.cs(meter name:31,resilience.polly.strategy.events:52,AddMeter:322, the duration-histogram opt-in:332, config key:25). Citations inside the earlier Revision sections are left as recorded.
Revision (2026-10-21)
Re-verified against current source. The Decision's three points, the reference objectives, the
Stripe single-retry-owner pipeline, the Polly meter wiring and both consumers' 8-day dr-freshness
gates stand as recorded. Three statements are made more precise, and line positions moved.
- The gRPC retry predicate is narrower than "retries only an
HttpRequestException" (the 2026-10-01 wording): it retries anHttpRequestExceptiononly when itsHttpRequestErrorisNameResolutionError,ConnectionErrororSecureConnectionError, a failure before the request was sent (MMCA.Common/Source/Presentation/MMCA.Common.Grpc/DependencyInjection.cs:142-147). AResponseEnded,HttpProtocolError,InvalidResponseorUnknownerror is not retried, because the call may already have reached the handler. A theory inResilienceHandlerTestsproves each case (MMCA.Common/Tests/Presentation/MMCA.Common.Grpc.Tests/ResilienceHandlerTests.cs:99-123). Decision point 1 and the Trade-offs entry now say so. - The outbox breaker wraps the integration-event
IMessageBuspublish, not strictly the broker hop: on a host with broker messaging that is the broker publish, and on a monolith the defaultInProcessMessageBusruns the integration-event handlers in-process inside the breaker, so failing handlers can open it too. Only the pure domain-event dispatch branch sits outside it (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Persistence/Outbox/Processing/OutboxProcessor.cs:776-791, field documentation at:101-106). It remains a breaker with no retry (:1072-1083). - The database posture recorded on 2026-08-18 applies to both engines, not only SQL Server:
PostgreSQLDbContextsets the sameCommandTimeoutandEnableRetryOnFailure(5 retries, 10-second maximum delay) (MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Persistence/DbContexts/PostgreSQLDbContext.cs:66,:74-77) asSQLServerDbContext(SQLServerDbContext.cs:55,:63-66). - Anchors re-verified against current source:
AddTypedGrpcClient's standard handler atDependencyInjection.cs:129-152, with theSocketsHttpHandleroverride at:103-120; theResilienceHandlerTestspin test at:140-150and the HTTP-tie test at:153-160(:53-77and:81-96unchanged); the outbox broker pipeline field atOutboxProcessor.cs:116, built byBuildBrokerPublishPipelineat:1072-1083, wrapping the publish at:781-785with the domain-event branch outside it at:787-791, andBrokenCircuitExceptionrecognized at:613;CreateExecutionStrategy()atMMCA.Common/Source/Core/MMCA.Common.Infrastructure/Persistence/DbContexts/Factory/DbContextFactory.cs:602; the global handler atMMCA.Common/Source/Hosting/MMCA.Common.Aspire/Extensions.cs:49-64(POST and PATCH excluded at:63) insideConfigureHttpClientDefaults(:39-87); the Polly meter wiring inExtensions.Telemetry.cs(AddMeter:323, the duration-histogram opt-in:333; meter name:31, instrument:52and config key:25unchanged); the StripeIsTransientFailureatMMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripePaymentService.cs:571-578(the timeout arm at:576; the pipeline at:76-113unchanged); thedr-freshnessgates atMMCA.ADC/.github/workflows/deploy.yml:845-857andMMCA.Store/.github/workflows/deploy.yml:790-801(the 8-day window at:854and:798); and the ADC drill table's last row atMMCA.ADC/infra/DISASTER-RECOVERY.md:204. Citations inside the earlier Revision sections are left as recorded.
Revision (2026-10-26)
Re-verified against current source. The Decision's second and third points, the reference
objectives, the outbox breaker, the database posture on both engines, the Stripe single-retry-owner
pipeline, the Polly meter wiring and both consumers' 8-day dr-freshness gates stand as recorded.
One registration site recorded since 2026-06-14 no longer exists, and line positions moved.
AddTypedServiceClient<TInterface, TImplementation>was removed in v1.254.0 (MMCA.Common/CHANGELOG.md:150, under the heading at:135), together withTypedServiceClientRegistrationTests. No first-party consumer called it, and gRPC throughAddTypedGrpcClientis the supported cross-service client; a host that wants a typedHttpClientregisters it withAddHttpClient. The CHANGELOG pairs that withAddStandardResilienceHandler, which a host withoutAddServiceDefaultsneeds; in a host that callsAddServiceDefaultsthe factory-created client already receives the standard handler fromConfigureHttpClientDefaults(Extensions.cs:50,:60), so adding a second would stack two pipelines. Context point 1 and Decision point 1 now nameAddTypedGrpcClientas the one framework registration site, with outboundHttpClientcoverage (clients created throughIHttpClientFactory; a hand-builtnew HttpClient(...)is not reached) coming from the global Aspire handler (MMCA.Common/Source/Hosting/MMCA.Common.Aspire/Extensions.cs:60-85, values fromHttpResilienceDefaultsat:62-65, POST and PATCH excluded at:74). The Trade-offs entry no longer cites the deleted registration test and citesServiceDefaultsRetryTestsfor the HTTP default instead. The mentions in the 2026-10-01 and 2026-10-06 revisions are left as recorded.- Anchors re-verified against current source:
ConfigureHttpClientDefaultsatExtensions.cs:50-108; the Polly meter wiring inMMCA.Common/Source/Hosting/MMCA.Common.Aspire/Extensions.Telemetry.cs(config key:24, meter name:30,resilience.polly.strategy.events:51,AddMeter:321, the duration-histogram opt-in:331with theDropview at:333-338); the outbox broker pipeline field atMMCA.Common/Source/Core/MMCA.Common.Infrastructure/Persistence/Outbox/Processing/OutboxProcessor.cs:118(its documentation at:103-117),DeliverAsyncat:772-794wrapping theIMessageBuspublish at:783-787with the domain-event branch outside it at:789-793,BrokenCircuitExceptionrecognized at:615, andBuildBrokerPublishPipelineat:1077-1088(a breaker with no retry,OperationCanceledExceptionexcluded at:1086);PostgreSQLDbContext'sCommandTimeoutatMMCA.Common/Source/Core/MMCA.Common.Infrastructure/Persistence/DbContexts/PostgreSQLDbContext.cs:94andEnableRetryOnFailureat:102-105(5 retries:103, 10-second maximum delay:104); the StripeIsTransientFailureatMMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripePaymentService.cs:569-576(the timeout arm at:574; the pipeline at:76-113, retry:77, breaker:94, bothShouldHandlepredicates throughIsTransientFailureat:87and:101); and thedr-freshnessgates atMMCA.ADC/.github/workflows/deploy.yml:846-858andMMCA.Store/.github/workflows/deploy.yml:791-802(the 8-day window at:855and:799). Citations inside the earlier Revision sections are left as recorded.
Revision (2026-10-28)
Re-verified against current source. The Decision, the reference objectives, the outbox breaker, the
database posture, the Stripe single-retry-owner pipeline and the removal of AddTypedServiceClient
(no match remains under MMCA.Common/Source) stand as recorded. Only line positions moved, as
later releases pushed the CHANGELOG entry down.
- Anchors re-verified against current source: the
AddTypedServiceClientremoval atMMCA.Common/CHANGELOG.md:193, under the### Breakingheading at:191of the## [1.254.0] - 2026-10-24section at:178(Decision point 1 re-pointed from:150). The StripeIsTransientFailuresits atMMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripePaymentService.cs:607-614(the timeout arm at:612), with the pipeline at:76-113, retry:77, breaker:94and bothShouldHandlepredicates throughIsTransientFailureat:87and:101unchanged. Citations inside the earlier Revision sections are left as recorded.
Revision (2026-11-12)
The Decision's second and third points, the reference objectives, the outbox breaker, the database posture and the Stripe single-retry-owner pipeline stand as recorded. Decision point 1 stands with two named exceptions, and three parts of the posture this record could not previously point at are recorded.
- The two factory-created clients outside the standard handler. The outbound webhook client
(
MMCA.Common/Source/Core/MMCA.Common.Infrastructure/Webhooks/WebhookServiceCollectionExtensions.cs:87-102) clears the host's additional handlers (:101), so the globalConfigureHttpClientDefaultshandler (MMCA.Common/Source/Hosting/MMCA.Common.Aspire/Extensions.cs:60-85) never reaches it. That is deliberate: the internal-command queue is its only retry and its only failure policy (WebhookServiceCollectionExtensions.cs:48-50), and a Polly retry underneath would multiply every delivery attempt. The gateway's downstream health-probe client (MMCA.Common/Source/Hosting/MMCA.Common.Aspire/Gateway/GatewayHealthCheckExtensions.cs:190) removes every resilience handler (:204-221), so a refused attempt reaches the check at once and a probe is not retried inside its own budget. Decision point 1 now names both, and ADR-142 records the webhook lane's own budget. - Infrastructure health checks are bounded.
AddInfrastructureHealthChecksregisters every check it adds with the timeoutHealthChecks:CheckTimeoutSeconds(MMCA.Common/Source/Hosting/MMCA.Common.Aspire/Extensions.Health.cs:50-53, resolved once at:78and handed to the database checks at:80, the Redis check at:94-99and the RabbitMQ check at:118-122). The setting defaults to 5 seconds and accepts 1 to 60 (MMCA.Common/Source/Hosting/MMCA.Common.Aspire/Health/HealthReportCacheOptions.cs:54-55, bounds at:32and:35);CheckTimeoutthrows at registration on a value outside that range (Extensions.Health.cs:279-291, the message at:287-288). A check still running at the timeout is cancelled and reported with its failure status, so a dependency that does not answer turns/healthunhealthy rather than leaving the last report in place (:50-53). The RabbitMQ check needs more than the registration timeout, because the health-check package calls its connection factory without a token (:107-115): it probes through ONE reused connection held byRabbitMqHealthConnection, created single flight under a token cancelled at the same timeout, the wait abandoned at that timeout even if the client ignores the token, and a failed creation not kept (MMCA.Common/Source/Hosting/MMCA.Common.Aspire/Health/RabbitMqHealthConnection.cs:5-16, constructed with the check timeout atExtensions.Health.cs:116). - The gateway has an opt-in connect-failure retry. A gateway host that sets
MmcaGateway:Retry:Enabled(off by default,MMCA.Common/Source/Hosting/MMCA.Common.Gateway/GatewaySettings.cs:64) retries a proxied body-less GET or HEAD whose attempt failed with a name-resolution, connect or TLS handshake error, the same before-send rule as the gRPC predicate in Decision point 1 (MMCA.Common/Source/Hosting/MMCA.Common.Gateway/Forwarding/GatewayConnectRetryHandler.cs:36-38,:41-44), at mostMaxRetryAttemptstimes (default 1, range 1 to 3) afterDelay(default 200 ms, at most 5 s) (GatewaySettings.cs:66-72). It is not a Polly pipeline: it is a handler on the clients YARP's own forwarder client factory builds (.../Forwarding/GatewayRetryForwarderHttpClientFactory.cs:12), not on a factory-created client, so the standard handler's retry budget does not apply to that hop; no request with a body and no other method is ever retried. ADR-088 records it in full, as an exception to its delegation of proxy-hop retries. - The objectives have an executable outage tier.
DependencyOutageTestBase(MMCA.Common/Source/Hosting/MMCA.Common.Testing.Aspire/Outages/DependencyOutageTestBase.cs:35) stops a dependency of a running AppHost, asserts that readiness follows a database and never a broker or a cache while liveness follows nothing, restarts it, and asserts recovery, including an outbox drain after a broker outage whose scenario names the outbox database (:11-21,:134,:162). ADR-117 owns the test base.
Revision (2026-11-23)
Re-verified against current source. The Decision's three points, the reference objectives, the gRPC
values (8s attempt, 20s total, one retry, the 0.5 / 10 / 10s breaker), the before-send gRPC retry
predicate, the POST and PATCH opt-out on the HTTP default, the removal of AddTypedServiceClient,
the Stripe single-retry-owner configuration, the health-check timeout and both consumers' 8-day
dr-freshness gates stand as recorded. Three statements are made more precise, and line positions
moved.
- Which factory builds the YARP forwarder client depends on configuration. Decision point 1
cited the framework's
GatewayRetryForwarderHttpClientFactory(MMCA.Common/Source/Hosting/MMCA.Common.Gateway/Forwarding/GatewayRetryForwarderHttpClientFactory.cs:12, a subclass of YARP'sForwarderHttpClientFactory) as the builder.AddMmcaGatewayregisters it only whenMmcaGateway:Retry:Enabledis true (MMCA.Common/Source/Hosting/MMCA.Common.Gateway/GatewayReverseProxyExtensions.cs:108-110; off by default,GatewaySettings.cs:64), so in the default configuration YARP's stock factory builds the client. Either way it is not a factory-created client and the standard handler does not reach it. Decision point 1 now says so. - Store's Stripe pipeline is its own class, shared by two callers. The retry-then-breaker
pipeline the 2026-09-11 to 2026-10-28 revisions place inside
StripePaymentServicenow lives inStripeResiliencePipeline(MMCA.Store/Source/Modules/Sales/MMCA.Store.Sales.Infrastructure/Payments/Stripe/StripeResiliencePipeline.cs:42-79: retry:43, breaker:60, bothShouldHandlepredicates throughIsTransientFailureat:52-53and:66-67,IsTransientFailureat:105-112with the timeout arm at:110). It is registered once as a singleton (.../Sales.Infrastructure/DependencyInjection.cs:42) so breaker state accumulates across calls.StripePaymentServiceruns its checkout-session and expiry calls through it (ExecuteStripeAsyncatStripePaymentService.cs:452-461, called at:130,:164and:218), andStripeTaxCalculatorruns its tax calculation through it (StripeTaxCalculator.cs:83). The pipeline covers those payment and tax calls only, not all Stripe traffic:StripeWebhookRegistrationServicebuilds the shared client and calls the webhook endpoint API directly (StripeWebhookRegistrationService.cs:166-171), outside both the retry and the breaker. The SDK client is built withmaxNetworkRetries: 0(StripeClientFactory.cs:51) and an explicitTimeout(:46), so the pipeline is the single retry owner for the calls it wraps and the webhook registration calls get no retry at all. The settings defaults are unchanged:RequestTimeoutSeconds30 (StripeSettings.cs:53, range 1 to 120 at:52),RetryMaxAttempts3 (:93, range 1 to 10 at:92) andRetryDelayMs500 (:97, range 100 to 10000 at:96). - The RabbitMQ health check is the framework's own. The 2026-11-12 revision explains the reused
connection by "the health-check package calls its connection factory without a token". The Xabaril
AspNetCore.HealthChecks.*checks were replaced by internalIHealthCheckclasses (MMCA.Common/CHANGELOG.md:222, in the## [1.307.0]section at:188), and the RabbitMQ check isRabbitMqHealthCheck(MMCA.Common/Source/Hosting/MMCA.Common.Aspire/Health/RabbitMqHealthCheck.cs:15, registered atExtensions.Health.cs:118-123). The mechanism stands as recorded, with the reason now in source: the connection holder's own creation token, on the check-timeout budget, is what ends a handshake against a port that accepts the connection but never answers, and the probe's token only bounds its wait for that connection (Extensions.Health.cs:108-116;MMCA.Common/Source/Hosting/MMCA.Common.Aspire/Health/RabbitMqHealthConnection.cs:5-22). - Anchors re-verified against current source:
ConfigureHttpClientDefaultsatMMCA.Common/Source/Hosting/MMCA.Common.Aspire/Extensions.cs:57-116(scoping comment:54-56, handler:68-93,HttpResilienceDefaultsvalues:70-73, POST and PATCH excluded:82); theAddTypedServiceClientremoval atMMCA.Common/CHANGELOG.md:1130, under### Breakingof the## [1.254.0] - 2026-10-24section at:1115(no match remains underMMCA.Common/Source);AddTypedGrpcClient's handler atMMCA.Common/Source/Presentation/MMCA.Common.Grpc/DependencyInjection.cs:142-168(predicate:155-160, breaker:161-164,configureResiliencedocumented at:92-97and invoked last at:166-167);HttpResilienceDefaultsgRPC values atMMCA.Common/Source/Core/MMCA.Common.Shared/Resilience/HttpResilienceDefaults.cs:67-75, breaker:77-93,MaxRetryAttempts:32,CircuitBreakerSamplingDuration:18; the Store drill table's 2026-07-28 rows atMMCA.Store/infra/DISASTER-RECOVERY.md:216-218(ADC's last row unchanged atMMCA.ADC/infra/DISASTER-RECOVERY.md:204); thedr-freshnessgates atMMCA.ADC/.github/workflows/deploy.yml:1242-1254andMMCA.Store/.github/workflows/deploy.yml:1005-1016(both overdr-drill.ymlwithwindow-days: '8'at:1251and:1013, through the sharedfreshness-gatecomposite action at:1247and:1009); and the infrastructure health checks inMMCA.Common/Source/Hosting/MMCA.Common.Aspire/Extensions.Health.cs(behavior documented at:51-54, timeout resolved at:79and handed to the database checks at:81, the Redis check at:95-100and the RabbitMQ check at:118-123, the holder constructed at:116,CheckTimeoutat:294-307with the range test at:299and the throw at:301-303). Citations inside the earlier Revision sections are left as recorded.
Revision (2026-12-02)
The Decision's three points and the reference objectives table stand as written. Three facts about how far the drill evidence reaches are recorded.
- Only point-in-time restore is drilled; the geo-restore and long-term-retention gap is accepted.
The weekly drill restores one database to a recent point in time, verifies it Online and deletes
the copy (
MMCA.ADC/infra/DISASTER-RECOVERY.md:196-198), and every row of the ADC drill table is a PITR restore (:215-224). No drill has exercised a geo-restore into another region or a restore from a long-term-retention backup, although the DR doc documents both procedures (LTR at:144-147, region loss at:152). The owner accepts that gap and adds no quarterly geo-restore or LTR drill. The consequence is stated here: the 4 h full-region-loss RTO in the reference objectives above and in the ADC DR doc (:14) is a planning figure, not a measured one, and the drill evidence covers the accidental-data-loss and single-database rows only. - A failed drill blocks deploys until that database drills green. The shared
freshness-gatecomposite action takes an optionalfailure-key-job-prefixinput, empty by default (MMCA.Common/.github/actions/freshness-gate/action.yml:71-77). When it is set, the gate also reads the newest completed runs, and a job whose name starts with the prefix and that concluded failure (or timed out) with no success of the same job name in a newer run fails the gate; a cancelled or skipped job neither blocks nor clears (:28-34;MMCA.Common/CHANGELOG.md:21). Both consumers'dr-freshnesssteps passfailure-key-job-prefix: 'drill ('(MMCA.ADC/.github/workflows/deploy.yml:1285,MMCA.Store/.github/workflows/deploy.yml:1073), and bothdr-drill.ymlworkflows name the drill jobdrill (<database>)from the selected database (MMCA.ADC/.github/workflows/dr-drill.yml:107,MMCA.Store/.github/workflows/dr-drill.yml:108). A failed drill of one database therefore keeps the deploy gate red until a newer drill of that same database succeeds, and a green drill of another database in the rotation does not clear it. The 8-day window stands (MMCA.ADC/.github/workflows/deploy.yml:1283,MMCA.Store/.github/workflows/deploy.yml:1071). ADR-064 records the gate mechanics. - ADC's measured restores sit at the 1 h single-database RTO. ADC drill restores took 1.8 to
4.4 min through 2026-08-10 (
MMCA.ADC/infra/DISASTER-RECOVERY.md:215-220) and 25.6 to 58.7 min in the four most recent drills, 2026-11-09 to 2026-11-30 (:221-224). The DR doc's drift note places the time inside the platform restore itself, notes that MMCA.Store's identical drill stays in minutes, and leaves the cause not established (:226-230). Every drill passes the 2 h drill criterion (:202), but the slowest, 58.7 min, is at the 1 h single-service-database-corruption RTO (:12,:230-232), so that row is a target the drill does not demonstrate with margin. The drill workflow allows 90 min for this reason (:232).