Application resilience patterns
This page is the ION standard for self-preservation inside a service. It covers how a service handles transient faults, bad messages, duplicates, overload, and dependency failures without losing work or taking other services down with it. It also records how closely today’s services follow that standard.
Infrastructure recovery (zone loss, restore, failover) is covered by disaster recovery. Degraded-mode behavior and the generic rules for timeouts, backoff, and circuit breakers are covered by the graceful degradation guidelines. This page does not repeat them. It applies them to the ION runtime: Azure Functions, Service Bus, Cosmos DB, and webhooks.
Services surveyed
| Service | Role | Tier | Hosting (prd) |
|---|---|---|---|
boundedctx-incidents | Incidents event store: commands, events, projections, replay | T0 | Two Linux Consumption (Y1) Function Apps, messaging (app_scale_limit 25) and HTTP (app_scale_limit 5) |
| Pigeon | Escalation and customer notifications: email, Teams, voice (Twilio) | T0 | P0v3 App Service plan, always_on, 2 workers |
| Phoenix | Microsoft Graph subscriptions for Teams messages, forwarded to Pigeon | T1, through FL-05 in the flow catalogue | Consumption Function App, app_scale_limit 6 |
All three run .NET 10 on the Azure Functions v4 isolated worker, use the shared
sbus-rome-* Service Bus namespace
(ADR-0008),
and send telemetry to Application Insights with sampling disabled. None of them
uses Durable Functions or Temporal. SOC automation, which runs on Temporal, is
covered only for its per-customer flood protection, in
section 7.
Mapping to the reliability requirements
The V3 requirements set four application-level reliability requirements. This table shows which patterns satisfy each one and how far ION gets today.
| Requirement | Patterns on this page | Status today |
|---|---|---|
| REL-1 Detect and notify processing failures and unavailable dependencies within 60 seconds | Detection and alerting, health endpoints | Partial. Telemetry is complete, but DLQ alerts cover few entities, and the one Incidents DLQ alert uses a 15-minute window. See RES-06 and RES-13 |
| REL-2 Reject or dead-letter invalid messages without crashing or blocking unrelated work | Classify failures, redelivery and dead-lettering | Mostly met. Schema validation and dead-lettering are in place. Phoenix retries invalid messages until they dead-letter (RES-09) |
| REL-3 Continue in a controlled degraded mode when a dependency is unavailable | Back-pressure, kill switches, webhooks | Partial. Service Bus buffers work during outages. There are no circuit breakers and no notification channel fallback (RES-17, RES-18) |
| REL-4 Make retries safe through idempotency, deduplication, and ordering | Idempotency, ordering | Partial. The event store is strong. The commands topic has no duplicate detection, Pigeon’s outbound sends have no idempotency key, and Phoenix has a constant MessageId fallback (RES-04, RES-05, RES-10) |
The message lifecycle
Most ION work arrives as a Service Bus message. Every handler follows the same lifecycle. The patterns below describe each step.
There is one path the lifecycle does not have: catch the exception, log it, and complete the message. That path loses work silently. It is the most serious gap found in the survey (RES-01, RES-02).
The ION standard
1. Classify every failure
-
Handlers MUST classify each failure as one of three kinds and handle it as follows.
Kind Examples Handling Transient Timeouts, 429,5xx, Service Bus or Cosmos DBServiceUnavailableThrow, so that Service Bus redelivers the message Permanent (poison) Schema violation, bad signature, unknown aggregate Dead-letter at once with a reason and description. Do not retry Business rule Invalid state transition, rejected command Publish a failedevent so the caller learns the outcome, then complete -
Handlers MUST NOT catch all exceptions and complete the message. A catch-all is allowed only if it dead-letters the message or publishes a failure event, and records telemetry that an alert can fire on.
-
Timer and change-feed functions have no dead-letter queue. A permanent failure there MUST emit an alertable telemetry event, and a transient failure MUST throw so that the function retry policy applies.
Reference implementations (Verified):
boundedctx-incidents:CommandHandlerServiceBaseturns a business-rule failure into afailed.v1outbound event instead of a dead-letter.- Phoenix: timer functions separate
RetryableException(retried) fromPersistentException(not retried). boundedctx-incidents: events of an unknown type are logged and completed. This is allowed on shared topics for forward compatibility, because the consumer is not the owner of that event type.
2. Retry transient faults
There are three retry layers. They do different jobs, and a service needs all three.
| Layer | What it retries | ION standard |
|---|---|---|
Service Bus client (host.json clientRetryOptions) | SDK operations: connect, receive, complete, publish. Not handler failures | Exponential, delay 5 s, maxDelay 1 min, maxRetries 5, tryTimeout 60 s |
| Service Bus redelivery | Handler failures. Redelivery is immediate; it is not backoff | max_delivery_count per section 3 |
| Outbound dependency client | HTTP calls to Graph, Twilio, Signet, and other APIs | Shared IonHttpPolicy or the SDK’s own retry handler, honouring Retry-After |
- Every Function App that uses Service Bus MUST set
clientRetryOptionsinhost.jsonto the ION standard above. - Outbound HTTP clients MUST be created through
IHttpClientFactorywith a bounded, jittered retry that honoursRetry-Afteron429and503, and an explicit timeout. The graceful degradation guidelines set the general rules. - Microsoft Graph clients MUST keep the Graph SDK retry handler in the middleware pipeline, or provide an equivalent.
- A handler that needs a delay before retrying SHOULD schedule a new message
(
ScheduledEnqueueTime) and complete the current one, rather than relying on immediate redelivery. Pigeon’s voice campaign retry (3 attempts, 30 s apart) is the reference. - Function-level retry attributes (
ExponentialBackoffRetry,FixedDelayRetry) are supported only for timer, Cosmos DB, Event Hubs, and Kafka triggers. Services MUST NOT rely on them for Service Bus triggers. - The total retry time of all layers MUST fit inside the message lock
duration (with auto-renewal) and the
functionTimeout.
Observed:
boundedctx-incidentsand Phoenix setclientRetryOptionsto the standard (Verified). Pigeon does not set it and runs on SDK defaults (Verified).- Phoenix timers use
ExponentialBackoffRetry(3, "00:00:02", "00:08:00")(Verified). - Pigeon classifies Twilio
408,429,500,502, and503as transient (Verified). - Pigeon’s Graph and Teams client (
GraphClient.cs) converts every exception to aFailedresult, with no retry and no429handling (Verified). RES-03. IonHttpPolicyretry counts and backoff values (Inferred). The JWT client uses a 3-second timeout (Verified).
3. Redelivery and dead-lettering
-
max_delivery_countMUST be set explicitly in Terraform for every subscription and queue.Entity type max_delivery_countWhy Commands, events, projections 3 Fails fast to the DLQ. With sessions, a poison message blocks its workspace session until it is dead-lettered Replay, purge, forwarding bridges 10 Long-running maintenance work that tolerates more transient failures -
Dead-lettering on message expiration MUST be on, as the DR guidelines require.
-
Message TTL on T0 entities in
prdMUST be longer than the T0 RTO of 4 hours. ION usesP7Dinprd. -
Every subscription and queue MUST have a dead-letter alert: dead-lettered count greater than 0, routed to the owner team and SRE. The
DlqMonitorFuncin each service publishes the dead-letter counts as a custom metric (Inferred: the logic is inServiceBusDlqCountMetricService); the alert must be defined on top of it or on the Service Bus metric. -
Dead-lettered messages are resubmitted with the procedure on the Service Bus DR page.
Observed (Verified):
boundedctx-incidents: 3 on commands, events, and projections; 10 on replay, purge, and the bridge. TTLP7Dinprd.- Pigeon: 3, and 10 on the bridge. TTL
PT4Hin alpha and beta,P3Din gamma,P7Dinprd. - Phoenix: the onboarded-subscription entity uses 5 with TTL
P7D. The notification queues leavemax_delivery_countat the Azure default and use a 30-minute TTL with dead-lettering on expiry. - Dead-letter alerts:
boundedctx-incidentshas one (on the external commands subscription, with a probable dimension defect), Pigeon covers 2 of about 8 entities, and Phoenix has none. The sharedtf-alertsService Bus module is generic: each service passes the metric, such asDeadletteredMessages, and the entities to watch, so coverage depends on each service’s instantiation. RES-06.
4. Idempotency and duplicate detection
Service Bus delivers at least once. Every handler sees duplicates eventually.
- Every handler MUST be idempotent, as the Service Bus DR rules already require.
- Publishers MUST set
MessageIdto a value derived from the business identity of the message: the event ID, the command ID, or the provider’s notification ID. They MUST NOT use a constant fallback. - Topics and queues that receive commands or external input SHOULD enable
duplicate detection. The ION window is
PT5M, andPT10Mfor customer contact ingestion. Duplicate detection cannot be switched on for an existing entity: the entity must be recreated, with a migration plan for messages in flight. - Event-store appends MUST use optimistic concurrency on the expected stream version.
- Projections MUST be idempotent on the event’s identity or version, for
example by comparing an etag or by using
MERGEorIF NOT EXISTS. - Side effects that reach people (email, Teams, voice) MUST record an idempotency key before or atomically with the send, so that a redelivered message does not notify a customer twice.
Reference implementations (Verified):
boundedctx-incidentsappends withAppendToStreamAsync(key, aggregate.Version)and rejects a stale version.boundedctx-incidentsSQL projections compare a UUIDv7event_store_etag(UPDATE … WHERE event_store_etag <> @etag) and useIF NOT EXISTSandMERGE.- Pigeon uses Redis
GetOrSetAsyncwith a 60-second TTL to deduplicate comment and use-case IDs, deduplicates action cards by request ID, and treats a Table Storage409as “already done”. The key SHOULD live at least as long as the message can be redelivered; 60 seconds is too short (RES-10). - Duplicate detection is on for
IntIncidentStoreandIntEventProcess(PT5M),ExtOutgoingEvents(PT1M), and Pigeon’sIntCustomerContactIngestion(PT10M) andIntEventIngestion(PT5M).
Gaps: the ExtIncidentStore commands topic has no duplicate detection
(RES-04). Phoenix falls back to new Guid().ToString(), which is the all-zeros
GUID, and its queues have no duplicate detection (RES-05). Pigeon’s
deduplication window is too short, and escalation and voice sends have no
idempotency key (RES-10).
5. Ordering and concurrency control
- When the order of messages matters, the entity MUST use sessions keyed
on the ordering scope. ION keys sessions on the workspace ID.
maxConcurrentSessionsthen bounds parallelism across workspaces. - Where per-field order cannot be guaranteed, handlers SHOULD compare field-level timestamps and keep the newest value, as the Incidents projections do.
- Writes to a shared document SHOULD use optimistic concurrency (an ETag match). Last-writer-wins is allowed only where the document has a single writer, and the page for that service must say so.
- Create operations SHOULD be atomic (create-if-not-exists), not check-then-create.
Observed (Verified): boundedctx-incidents uses workspace sessions with
support_ordering, Cosmos DB partition /partition_id, stream key
{workspace}_{incident}, and field-level timestamps. Pigeon uses
SessionId = WorkspaceId but writes with ETag.All. Phoenix upserts with no
etag and onboards with check-then-create (RES-12).
6. Timeouts and execution budgets
functionTimeoutSHOULD be explicit inhost.json. The Consumption default is 5 minutes; the dedicated-plan default is 30 minutes.- Long operations MUST carry a budget below the host limit and return a continuation when the budget runs out.
- Every outbound call MUST have a timeout shorter than the caller’s own budget.
- The Service Bus lock, including auto-renewal, MUST outlast the handler’s worst-case duration, or the message is redelivered while it is still being processed.
Reference implementations (Verified):
| Service | Budget | Limit it protects |
|---|---|---|
boundedctx-incidents | Purge SQL commandTimeout 240 s | 5-minute Consumption default |
| Pigeon | Purge CancellationTokenSource of 200 s, returning 408 with HasMoreData so the caller continues | 230-second HTTP request limit of the front end |
| Pigeon | Twilio ring timeout 60 s, gather timeout 20 s | Voice call duration |
| Phoenix | functionTimeout 5 minutes | Explicit |
7. Concurrency limits and back-pressure
Scale-out protects the service but can overwhelm what is behind it. Limits keep the downstream stores and APIs inside their capacity.
- Every Function App MUST set
app_scale_limit(or the plan’s instance limit) to a value the downstream stores can absorb. - Service Bus handlers SHOULD set
maxConcurrentSessionsormaxConcurrentCallsexplicitly, sized against Cosmos DB RU and SQL DTU or vCore capacity. - HTTP-heavy Function Apps SHOULD set
maxConcurrentRequests,maxOutstandingRequests, anddynamicThrottlesEnabled, so that overload becomes a429instead of a crash. - Public APIs MUST have an APIM rate limit.
- Bulk maintenance (purge, replay) MUST be paced.
Observed (Verified):
| Control | boundedctx-incidents | Pigeon | Phoenix |
|---|---|---|---|
| Instance limit | 25 messaging, 5 HTTP | 2 workers | 6 |
| Service Bus concurrency | maxConcurrentSessions 48, maxConcurrentCalls 3, prefetchCount 150 | Defaults | maxMessageBatchSize 25 |
| HTTP throttles | Defaults | Defaults | maxConcurrentRequests 30, maxOutstandingRequests 200, dynamic throttles on |
| Host health monitor | 1-minute window, threshold 10, counterThreshold 0.85 | Defaults | 10-second interval, 2-minute window, threshold 6, counterThreshold 0.8 |
| APIM rate limit | Per API | 300 calls per 60 s; Twilio webhooks 100 per 60 s | Not applicable |
| Bulk pacing | Purge: 250 ms between partition deletes, SQL batches of 2,000 | Purge budget (section 6) | Not applicable |
No service uses a circuit breaker (RES-17).
Per-customer isolation in the incident pipeline
The limits above protect the platform as a whole. They do not, on their own, stop one customer’s burst from delaying the others. Two controls do that.
- Per-customer session lanes. Sessions are keyed on the Sentinel
workspace ID, which is one per customer (section 5). A session is processed
by one handler at a time, and
maxConcurrentSessionsspreads handlers across workspaces. A burst from one customer therefore queues up in that customer’s own lane instead of using every handler. Conveyor publishes incident actions withSessionId = WorkspaceId(ServiceBusIncidentActionsClient.cs, Verified). - Flood protection in SOC automation (FLD-001). Lanes stop a burst from using every handler, but each incident in the burst still gets a full automation run, with its enrichment calls and Microsoft API quota. FLD-001 groups near-identical incidents from one customer under a single parent incident, so automation runs once for the whole burst.
Observed (Verified): Conveyor’s throttle-v2 stage does not throttle. It
republishes every message as INCIDENT_NOT_THROTTLED, the Throttling:* App
Configuration keys are never read, and the Execute_Throttled flag is never
used (RES-23). Archer’s CacheThrottleAsync limits Sentinel writes per
incident, not per customer, behind the ENABLE_KRO_2711 flag. Neither is a
per-customer control.
Flood protection in SOC automation (FLD-001)
- SOC automation MUST cap bursts of near-identical incidents per customer, so that one customer’s flood cannot cause automation outages, timeouts, or Microsoft API rate limiting for everyone.
- The flood guard MUST run in the first rank of the automation plan, and
it MUST be dispatched by a configuration-engine rule with
execution_policy: barrier. Otherwise its stop directive is logged and ignored. - The flood guard MUST fail open. If it cannot verify flood state, the incident gets normal automation.
Why it exists. On 15 January 2026, one customer received more than 2,000 incidents with the alert “A potentially malicious URL click was detected” in a short period. Most had one matching entity. Microsoft did not group the alerts into one incident of about 150 alerts; it created more than 2,000 incidents of 1 to 5 alerts each. The SOC could not prioritise them by hand, and SOC automation went down.
Status (Verified): deployed in production. The workflow is
fld-001-flood-guard, in
cerebro-content/app/soc-automation/src/libs/workflows/flooding/. Its
configuration is workflows/config/flooding_config.json. The shared counter
and state are in
ziege/libs/ontinue-ziege-automation/src/ontinue/ziege/automation/
(flood_counter.py, flood_state.py). The barrier rule is configuration-engine
data, not code. The stop directive is honoured in
ziege/app/incident-manager/src/libs/workflows/plan_execution.py
(_authorized_stop). Delivered under NYX-2044, with the barrier policy under
NYX-2010.
How it works.
- Scope. The workflow builds one or more scopes for each incident from its
alerts: the workspace (customer) plus the alert dimensions configured in a
rule. Today every rule uses
alert_display_name. - Count. It adds the incident ID once per scope to a Redis sorted set,
ziege:flood-counter:v1:{workspace}:{fingerprint}, and keeps members for twice the window. It counts incidents, not alerts. - Claim. If the count in the window is above the rule’s threshold, it
claims the flood atomically with a Lua script
(
ziege:flood:v1:...). The incident that crosses the threshold becomes the parent and gets normal automation. - Suppress. While the flood state is active, every later matching incident
from that customer is a child. The workflow returns the decision
force-closewith the closure comment"Handled in incident {parent}". It posts a public comment on the child that points to the parent, and one on the parent that points to the child. It then returnsExecutionControl(directive="stop"), so later ranks are skipped. - End. The flood ends only when its state expires after the TTL. Nothing renews or releases it. If the burst continues, the next incident over the threshold becomes a new parent, roughly once per TTL.
Configuration in production (Verified):
| Rule | Type | Matches | Flood starts when | Window | TTL |
|---|---|---|---|---|---|
epp | Specific | alert_display_name starts with “Email reported by user as malware or” | More than 50 incidents | 30 minutes | 30 minutes |
fallback-alert-name | Fallback | Each alert name that no specific rule claims | More than 100 incidents | 30 minutes | 30 minutes |
A fallback rule sees only the alerts that no specific rule claimed. If the
configuration cannot be read, the built-in default applies: dimensions
product_name and alert_type, more than 100 incidents, 30-minute window and
TTL.
Design decision: incidents with mixed alerts are suppressed too. A child incident that also contains alerts of other types is still force-closed. This is intended. The parent incident is investigated in full, and the flood handling covers the further alerts and incidents from the same attack or false-positive scenario. The original requirement excluded mixed incidents; that exclusion was dropped on purpose.
Observability. The workflow logs flood_started and
flood_child_suppressed events with zge.flood.* fields. A Sentinel analytic
rule in tangela alerts the SOC shifts once per flood. It was not located
during this review.
Planned, not built:
- Stop the SLA on child tickets instead of force-closing them. This depends on bulk close in Alya and on automation being able to stop an SLA.
- Re-run automation in bulk on the children once the flood is handled.
- A configurable rank sequence, to replace the fixed first-rank placement.
8. Inbound webhooks
Providers such as Twilio and Microsoft Graph call ION back over HTTP. They retry on their own schedule, and Graph can disable a subscription whose endpoint keeps failing.
- Webhooks MUST validate the origin at the edge (
X-Azure-FDID) and the provider signature, at APIM and again in the application. - Webhooks MUST acknowledge quickly: publish to Service Bus, then return
2xx. All business work happens in a worker behind the queue. - The response code MUST match the retry semantics. Return
2xxonly after the publish succeeds,5xxonly for transient failures you want the provider to retry, and4xxfor invalid requests that must not be retried. - The published
MessageIdMUST come from the provider’s event identity, so that provider retries are deduplicated.
Observed (Verified): Pigeon’s Twilio webhooks follow the pattern, apart
from deduplication (RES-10). Phoenix returns 500 for every exception, so
Graph also retries requests that can never succeed (RES-08).
9. Health endpoints
- Every Function App MUST expose a health endpoint that checks its critical
dependencies and reports optional ones as
Degraded, notUnhealthy. health_check_pathin Terraform MUST equal the route prefix plus the function route. With the defaultroutePrefixofapi, a function route ofv1/healthis served atapi/v1/health.- Health checks for a dependency client MUST be registered, or the endpoint reports healthy while the dependency is down.
Reference implementation (Verified): Pigeon’s v1/health checks Service
Bus, Key Vault, and the Conveyor queue (as Degraded), and its Terraform path
api/v1/health matches.
Gaps (Verified): boundedctx-incidents serves api/v1/healthcheck, but
Terraform sets api/healthcheck. Phoenix serves api/v1/health, but Terraform
sets /v1/health. Phoenix’s GraphApiClient health check is not registered.
RES-07.
10. Kill switches and degraded mode
- Behavior that can be shed under pressure MUST sit behind an Azure App Configuration feature flag, and be registered with the platform degraded-mode control described in the graceful degradation guidelines.
- Scheduled or automated state changes on T0 flows SHOULD have a kill switch.
Observed (Verified): boundedctx-incidents uses EnableKro* flags and has
a kill switch for scheduled state transitions. Phoenix has feature management
wired in but evaluates no flags (RES-20). Pigeon has no channel fallback, for
example from Teams to email, when a channel is down (RES-18).
11. Recovery tooling
- Every T0 service MUST have a documented way to rebuild its outputs: a replay command, a resubmit path, or a reconciliation tool.
- Destructive tooling MUST be paced and idempotent.
Reference implementation (Verified): boundedctx-incidents has Replay,
ReplayStream, and Purge commands and the IncidentSync tool. The
replay procedures describe how they
are used. The SQL projections for alerts and entities intentionally run without
a transaction and rely on replay for repair; comment and rating projections use
transactions.
12. Safe deployment
- Function Apps SHOULD deploy to a
deployslot and swap. - Slot-specific settings MUST be sticky. Timer triggers MUST be disabled
in the slot, and the slot MUST consume from its own
-deployslotsubscriptions, so that a warming slot never takes production messages.
Observed (Verified): all three services follow this pattern.
13. Detection and alerting
- Every service MUST send traces, structured logs, and dependency telemetry to Application Insights, as the shared libraries do today.
- Every T0 service MUST alert on: dead-lettered messages, function failure rate, and the lag of any change-feed or timer pipeline it owns.
- To meet REL-1, alert evaluation SHOULD use a frequency and window of 1 minute on T0 failure signals.
- Alert Terraform MUST be checked in the plan review. A typo in a variable name, a wrong metric, or a duplicated rule key silently removes coverage.
Observed (Verified):
boundedctx-incidents: one DLQ alert (Sev0, more than 0, 15-minute window). The SQL “CPU” rule usesstorage_percent, therule_2key is duplicated, and the variableservicbus_alerts_enabledis misspelled. There are no function-failure or change-feed lag alerts. RES-13.- Pigeon: DLQ and active-message (more than 300) Sev0 alerts on 2 entities.
- Phoenix: no DLQ alert. Its two log alerts are disabled in every environment and mislabelled.
- Every service instantiates the shared
tf-alertsmodules from the module registry in its own infrastructure. The owning teams report alerts deployed for almost all services. The reliability maturity model assesses this coverage.
Observed implementation matrix
| Pattern | boundedctx-incidents | Pigeon | Phoenix |
|---|---|---|---|
| 1. Failure classification | Yes, failed-event pattern. Change feed swallows errors (RES-01) | Partial. Escalation handler swallows errors (RES-02) | Partial. PersistentException swallowed in timers, recreation swallows errors (RES-19) |
| 2. Service Bus client retry | Standard | SDK defaults (RES-11) | Standard |
| 2. Outbound retry | IonHttpPolicy (Inferred) | Twilio yes, Graph no (RES-03) | Polly through the Doppio client (Inferred) |
3. max_delivery_count explicit | Yes | Yes | Partial (RES-09) |
| 3. DLQ alert on every entity | No (RES-06) | No (RES-06) | No (RES-06) |
4. Deterministic MessageId | Yes (Inferred, shared library) | Yes on ingestion | No, zero-GUID fallback (RES-05) |
| 4. Duplicate detection | Yes, except commands topic (RES-04) | Yes on ingestion | No (RES-05) |
| 4. Idempotent handlers | Yes, version and etag | Partial (RES-10) | Partial |
| 5. Sessions and ordering | Yes | Yes | Onboarding only |
| 5. Optimistic concurrency | Yes | No (RES-12) | No (RES-12) |
| 6. Explicit timeouts and budgets | Yes | Yes | Yes |
| 7. Concurrency limits | Yes | Defaults | Yes |
| 8. Webhook pattern | Not applicable | Yes, apart from dedup | No (RES-08) |
| 9. Health path correct | No (RES-07) | Yes | No (RES-07) |
| 10. Kill switches | Yes | No | Wired, unused (RES-20) |
| 11. Recovery tooling | Yes | Purge only | No |
| 12. Slot deployment | Yes | Yes | Yes |
| 13. Failure alerts | Partial (RES-13) | Partial | No |
Application failure catalogue
The catalogue lists failures that happen inside the application layer. The infrastructure failure modes are on the DR resource pages. Severity is the impact if the failure is not mitigated. Likelihood is for the current design.
| Problem | Risk | Source | Severity | Likelihood | Mitigation |
|---|---|---|---|---|---|
| Transient Service Bus, Cosmos DB, or SQL error during handling | Message redelivered up to max_delivery_count, then dead-lettered | Azure platform | Medium | High | Client retry, redelivery, DLQ alert and resubmit |
| Poison or invalid message | Retries waste capacity. With sessions, the workspace is blocked until the message is dead-lettered | Bad publisher, schema drift | High | Medium | Schema and signature validation, immediate dead-letter, max_delivery_count 3 |
| Duplicate delivery | Duplicate events, double notifications to customers | At-least-once delivery, provider retries | High | High | Deterministic MessageId, duplicate detection, idempotent handlers, send-side idempotency keys |
| Out-of-order delivery | An older value overwrites a newer one | Parallel publishers | Medium | Medium | Workspace sessions, field-level timestamps, version checks |
| Concurrent writes to one aggregate or document | Lost update | Scale-out | High | Medium | Optimistic concurrency on stream version or ETag |
Downstream throttling (Cosmos DB 429, SQL DTU, Graph 429, Twilio 429) | Retry storms, cascading failure | Dependency capacity | High | Medium | Scale limits, concurrency caps, Retry-After, pacing. No circuit breakers yet (RES-17) |
| External dependency outage (Graph, Twilio) | Notifications delayed or not sent | External provider | High | Medium | Service Bus buffering and redelivery to DLQ. No channel fallback yet (RES-18) |
| Exception swallowed and message completed | Silent loss of work with no alert | Code defect | High | Medium | Classification rules in section 1. RES-01, RES-02 |
| Change-feed publish failure | Events stored but never published. Downstream state goes stale until a manual replay | Code defect or Service Bus outage | High | Low | Rethrow with a retry policy, lag alert, replay. RES-01 |
Handler runs past its lock or functionTimeout | Double processing, abandoned work | Long operations | Medium | Medium | Execution budgets and continuations, lock renewal |
| Webhook flood or forged callback | Overload or spoofed events | External | High | Low | Front Door ID, signature validation, APIM rate limits |
| Incident flood from one customer: many near-identical incidents in minutes | Automation outage, timeouts, Microsoft API rate limits, SOC overload, other customers delayed | Ungrouped alerts at the source, internal phishing campaigns, noisy detections | High | Medium | Per-customer session lanes and FLD-001 flood protection (section 7). Fails open. RES-22 |
| Webhook handler fails | Provider retries pointlessly, or Graph drops the subscription | Code defect, dependency outage | Medium | Medium | Quick-ack, correct status codes. RES-08 |
| Graph subscription removed, not renewed, or missed notifications | Teams messages missed | External lifecycle | Medium | Medium | Lifecycle handling renews and recreates subscriptions, and timers retry. Recreation failures are swallowed. RES-19 |
| Messages expire during a consumer outage | Queued work lost | Outage longer than TTL | High | Low | TTL P7D in prd, dead-lettering on expiry |
| Partial SQL projection write | Read model inconsistent until repaired | By design for alerts and entities | Low | Low | Etag-idempotent projections and replay. Accepted |
| Faulty release | Error rate rises | Change | High | Medium | Slot deployment and swap back |
Gap register
These gaps are between the standard above and the code or Terraform of the surveyed services. HIGH means work can be lost silently, or a T0 failure goes undetected. Each gap closes when the code or Terraform matches the standard.
| ID | Severity | Service | Gap | Evidence | Target | Owner |
|---|---|---|---|---|---|---|
| RES-01 | HIGH | boundedctx-incidents | The change-feed publisher catches every exception and only logs it. The lease checkpoint advances, so events are silently not published until someone replays them | EventPublisherFunc.cs (Verified) | Rethrow with a Cosmos DB trigger retry policy, and alert on publish failures and change-feed lag | Incidents team |
| RES-02 | HIGH | Pigeon | ProcessEscalationInitiated catches every exception, so a failed escalation is completed and lost | ProcessEscalationInitiated.cs (Verified) | Throw on transient failures. Dead-letter or publish a failed event on permanent ones | Pigeon team |
| RES-03 | HIGH | Pigeon | Graph and Teams sends have no retry and no 429 handling. Every exception becomes a Failed result | GraphClient.cs (Verified) | Graph SDK retry handler or IonHttpPolicy, honouring Retry-After | Pigeon team |
| RES-04 | HIGH | boundedctx-incidents | The ExtIncidentStore commands topic has no duplicate detection | infrastructure-shared/main-svcbus.tf (Verified) | Duplicate detection PT5M. The topic must be recreated, with a migration plan | Incidents team |
| RES-05 | HIGH | Phoenix | The MessageId fallback is new Guid().ToString(), the all-zeros GUID. Outbound messages to Pigeon have no MessageId, and no queue has duplicate detection | ResourceNotificationHandler.cs, LifecycleNotificationHandler.cs, TeamsChangeNotificationRecord.cs (Verified) | A deterministic ID from the Graph notification, and duplicate detection on the queues | Phoenix team |
| RES-06 | HIGH | All three | Dead-letter alerts cover few entities: one in boundedctx-incidents (with a probable dimension defect), 2 of about 8 in Pigeon, none in Phoenix. The shared Service Bus alert module only alerts on the entities each service passes to it | Service alert Terraform, tf-alerts/azure (Verified) | A dead-letter alert on every subscription and queue, routed to the owner team and SRE | Owner teams, SRE |
| RES-07 | MEDIUM | boundedctx-incidents, Phoenix | health_check_path does not match the served route. Phoenix’s Graph health check is not registered | func-http.tf, func-messaging.tf, phoenix/infrastructure/main.tf, HealthCheckFunc.cs (Verified) | Correct the paths and register the check | Incidents team, Phoenix team |
| RES-08 | MEDIUM | Phoenix | The Graph webhook returns 500 for every exception | ExceptionHandlingMiddleware.cs (Verified) | 4xx for invalid input, quick-ack after enqueue | Phoenix team |
| RES-09 | MEDIUM | Phoenix | Invalid messages are abandoned and retried until they dead-letter. Notification queues leave max_delivery_count at the default | ResourceNotificationProcessorFunc.cs, LifeCycleNotificationProcessorFunc.cs, queue Terraform (Verified) | Dead-letter invalid messages at once with a reason. Set max_delivery_count explicitly | Phoenix team |
| RES-10 | MEDIUM | Pigeon | Deduplication uses Redis keys that live only 60 seconds (CustomerContactService, MessageSyncService, CustomDetectionService). That is shorter than a redelivery after a lock expiry, so late duplicates get through. Escalation and voice sends have no idempotency key, and Twilio callbacks are not deduplicated by CallSid | Services named in the gap (Verified) | A send-side idempotency key that lives at least as long as the message TTL, in Redis or Table Storage | Pigeon team |
| RES-11 | LOW | Pigeon | No clientRetryOptions or concurrency settings in host.json. SDK defaults apply | host.json (Verified) | The ION standard values | Pigeon team |
| RES-12 | MEDIUM | Pigeon, Phoenix | Last-writer-wins writes (ETag.All, null original ETag). Phoenix onboarding is check-then-create | TableStorageClient.cs, DefaultSubscriptionService.cs (Verified) | Optimistic concurrency and atomic create, or a recorded single-writer exception | Pigeon team, Phoenix team |
| RES-13 | MEDIUM | boundedctx-incidents | Alert defects: SQL “CPU” rule on storage_percent, duplicated rule_2 key, misspelled servicbus_alerts_enabled. No function-failure or change-feed lag alert. DLQ window is 15 minutes | Alert Terraform (Verified) | Fix the rules, add the missing alerts, 1-minute evaluation on T0 signals | Incidents team |
| RES-14 | MEDIUM | Phoenix | A message that does not fit in an empty batch makes the send loop repeat until the function times out | ResourceNotificationHandler.cs, LifecycleNotificationHandler.cs (loop Verified, runtime behavior Inferred) | Fail the oversize message explicitly | Phoenix team |
| RES-15 | LOW | Pigeon | throw; // TODO temp in the ingestion functions. Removing it would introduce a swallow | Ingestion functions (Verified) | Keep the rethrow and remove the TODO | Pigeon team |
| RES-16 | LOW | Pigeon | GraphServiceRequestHandler.Send calls RunSynchronously on a task that has already started, which throws. Only the synchronous Send path is affected, and the Graph SDK normally uses the asynchronous one | GraphServiceRequestHandler.cs (code Verified, reachability Inferred) | Remove the synchronous override, or read the content synchronously | Pigeon team |
| RES-17 | MEDIUM | All three | No circuit breakers on Graph, Twilio, or other external dependencies | Code (Verified) | Circuit breakers per the graceful degradation guidelines | Owner teams |
| RES-18 | MEDIUM | Pigeon | No channel fallback when a notification channel is down | Code (Verified) | A documented fallback order for T0 escalations | Pigeon team |
| RES-19 | MEDIUM | Phoenix | Recreating a subscription after subscriptionRemoved swallows every exception on purpose (KRO-1920) and logs only a warning. missed lifecycle events are only logged. Teams messages are missed until someone recreates the subscription through the admin API | DefaultSubscriptionService.cs, LifeCycleNotificationProcessor.cs (Verified) | Let recreation failures throw so they retry and dead-letter, and alert on them | Phoenix team |
| RES-20 | LOW | Phoenix | Feature management is wired, but no flag is evaluated, so there is no kill switch | Code (Verified) | A kill switch for subscription processing | Phoenix team |
| RES-21 | LOW | Shared libraries | Retry, timeout, and DLQ-metric defaults in the Ontinue.Ion.* libraries are not documented | Not in service repositories | Publish the defaults so services can be verified against this standard | Shared-library owners |
| RES-22 | MEDIUM | SOC automation (FLD-001) | Every child upserts the parent’s comment with the same static ID (_FLOODPARENT_COMMENT_NAMESPACE), so the parent shows only the latest child, not the list of all children | flood_guard.py _suppress (Verified) | A comment ID per child, or one comment that appends every child | VAL team |
| RES-23 | LOW | Conveyor | throttle-v2 is a pass-through. The Throttling:* App Configuration keys and the Execute_Throttled flag are never used | ThrottleService.cs, ThrottleHandlerFunc.cs, Constants.cs, infrastructure-config/main-throttled.tf (Verified) | Implement the throttle, or remove the dead configuration and the extra hop | Conveyor team |
Applying the standard to other services
The three surveyed services are a sample. Every other ION service that uses
Service Bus, Cosmos DB, or webhooks SHOULD check itself against
the ION standard and the
implementation matrix, and record its own gaps
here with new RES-xx IDs.