This guide explains how SET delivery streams behave at runtime, how the system responds to failures, and how operators recover from each failure class. It is the canonical vocabulary reference for stream lifecycle and error handling.
If you are configuring a deployment for the first time, read
docs/configuration_properties.md for the full env-var reference and
docs/Cluster.md for clustering. This document focuses on operational
behavior once the system is running.
An acknowledged event is a delivered event. Auto-recovery never invents acks. The system treats RFC8417 / RFC8935 / RFC8936 acknowledgement as a contract: a JTI is only marked delivered when the receiver confirmed receipt (HTTP
202for push; explicit poll-acknowledgement for poll).
This is the load-bearing rule for everything that follows:
ResetDate / ResetJti mechanism on StreamConfiguration. See the
recovery playbook.If a stream goes from enabled to disabled after exhausting retries, every
JTI that was unacked at the time of disable remains pending. Re-enabling the
stream replays them in order. Auto-recovery does not drop, dead-letter, or
silently ack any event.
Every stream — push or poll, transmitter or receiver — exposes a status
field with one of three values. The semantics are intentionally narrow so
that dashboards and alerts can be written against unambiguous meanings.
| State | Meaning | Self-healing? | Operator action required? |
|---|---|---|---|
enabled |
actively delivering | n/a | no |
paused |
the remote endpoint has self-paused; this side is waiting | yes | no |
disabled |
this side has given up; will not deliver until re-enabled | no | yes |
enabledNormal steady state. Push transmitters drain the buffer and POST events as
they arrive. Poll receivers poll on schedule. Any single failure may transition
the stream to paused (if the remote reports it) or initiate retry/recovery
(see failure classes). If the
stream eventually exhausts its retry budget, it transitions to disabled.
pausedThe local stream is in paused only because the remote endpoint reported
itself as paused via its /status endpoint. The local side stops
attempting delivery, persists the reason in ErrorMsg, and periodically
re-checks the remote status (every I2SIG_PUSH_PROBE_INTERVAL for push;
the equivalent I2SIG_POLL_PROBE_INTERVAL for poll). When the remote
re-enables, the local stream auto-resumes. No operator action is required.
If the remote pause persists indefinitely, the local stream stays in paused
indefinitely. This is intentional — the remote owns its state, and the local
side is correctly reflecting it. Operators may inspect why the remote paused
itself but cannot move this side out of paused other than by waiting for
the remote.
disabledTerminal state for this side. Reached via one of:
I2SIG_PUSH_RETRY_LIMIT (default 6h). 401 retried for
I2SIG_PUSH_AUTH_RETRY_LIMIT attempts (default 10)./status reports disabled — local side mirrors the remote’s
terminal state.FW) whose iss has no active key for its signing_alg sends nothing,
pauses with the reason no active signing key for issuer <iss> (<alg>),
retries the key every I2SIG_PUSH_AUTH_RETRY_DELAY, and disables after
I2SIG_PUSH_AUTH_RETRY_LIMIT failed tries. It resumes by itself if the key
is created or reactivated first. Events stay queued throughout.503 with a plain-text
body naming the issuer and algorithm; an SSTP exchange to this side gets
503 and nothing in it is applied; a dialing SSTP pair sends nothing. The
stream (both directions of a pair) pauses with the reason
<POLL-SRV|SSTP-SRV|SSTP-CLIENT>: no active signing key for issuer <iss> (<alg>)
and key_unavailable_since set to the first failure. Every
I2SIG_PUSH_AUTH_RETRY_DELAY each node checks those streams: once the key
is active it re-enables them (a dialing pair’s loop restarts); once
I2SIG_PUSH_AUTH_RETRY_LIMIT × I2SIG_PUSH_AUTH_RETRY_DELAY has passed
since key_unavailable_since it disables them. An operator’s status change
clears key_unavailable_since, so an operator pause is never resumed.disabled is the system’s signal that operator attention is required.
The stream’s ErrorMsg field contains the diagnostic. Re-enabling the stream
starts delivery again on the node that handled the request, without a
restart, and replays all unacked JTIs that accumulated while it was failing.
Re-enabling a signing transmitter that still has no active signing key is
refused with 400 and leaves the status unchanged.
When a push attempt completes, the response is classified into one of the buckets below. The classification drives the response.
| Push response | What it means | System response | Cap |
|---|---|---|---|
| HTTP 202 Accepted | success | ack JTI; reset backoff and idle timer | — |
| Transport error (DNS, refused, TLS, timeout) | network or cert problem | exp backoff; retry until cap; then disabled |
I2SIG_PUSH_RETRY_LIMIT (6h default) |
| HTTP 5xx (500/502/503/504) | server-side problem | same as transport error | 6h |
| HTTP 401 Unauthorized | auth rejected | bounded retries with fixed delay; then disabled |
I2SIG_PUSH_AUTH_RETRY_LIMIT × I2SIG_PUSH_AUTH_RETRY_DELAY (10 × 15s default) |
| No active signing key (nothing sent) | the transmitter’s own key is missing, suspended or revoked | ERROR log; paused; retry the key with fixed delay; resume when it is back, else disabled |
I2SIG_PUSH_AUTH_RETRY_LIMIT × I2SIG_PUSH_AUTH_RETRY_DELAY (10 × 15s default) |
| HTTP 403 Forbidden | auth forbidden | disabled immediately |
— |
| HTTP 429 Too Many Requests | rate-limited | honor Retry-After; if absent, exp backoff; no cap (peer back-pressure) |
none |
| HTTP 4xx other (404/410/422/…) | unexpected protocol | disabled + verbose log |
— |
| RFC8935 §2.4 error | receiver rejected the SET | see RFC8935 protocol errors | — |
Remote /status = enabled |
healthy | resume normal operation | — |
Remote /status = paused |
remote self-paused | local paused; re-check every I2SIG_PUSH_PROBE_INTERVAL |
— |
Remote /status = disabled |
remote disabled | local disabled |
— |
For transport errors and 5xx, the backoff is:
delay_n = min( BASE * FACTOR^n , MAX )
with defaults BASE=1s, FACTOR=2.0, MAX=5m. The cap is total elapsed
time (RETRY_LIMIT, default 6h), not attempt count — this prevents a
flapping receiver from accumulating an unbounded retry budget.
When the cap is reached, the stream transitions to disabled with
ErrorMsg recording the elapsed time and the last failure class.
RFC8935 §2.4 defines a small set of error codes the receiver returns in a
400 Bad Request body when it rejects a SET:
authentication_failedinvalid_requestinvalid_audienceinvalid_issuerinvalid_keyjws_signature_failedjwe_decryption_failedAll RFC8935 §2.4 errors are deterministic per-SET. The same signed token
will produce the same error every time it is re-pushed. There is no value in
retrying the same SET. The system therefore transitions the stream to
disabled on first occurrence and persists the offending JTI, error code,
and description in ErrorMsg. Operators see the failure immediately rather
than after a long retry budget elapses.
Single exception — jws_signature_failed: this can also indicate that
the receiver’s JWKS does not yet have our current signing key — a key
rotation race. The system handles this by:
If the retry succeeds (202 Accepted), the JTI is acked normally. If the
retry returns any 400 (including another jws_signature_failed), the stream
transitions to disabled — the problem is not a transient cache miss.
There is no dead-letter path for RFC8935 errors. Operationally, every RFC8935 §2.4 code reflects a configuration problem (wrong audience, wrong issuer, missing key, etc.) and the operator must intervene. See the recovery playbook for how to triage.
The table above is the transmitter’s view. When this server is the
receiver — an RFC 8935 push receiver endpoint, or the SSTP acceptor at
POST /sstp/{id} — it answers as follows. A SET that is not durably stored is
never acknowledged (ADR 0038), and a store failure is reported as retryable so
the sender keeps the SET instead of dropping it.
| Situation | Push receiver (RFC 8935) | SSTP acceptor | Sender should |
|---|---|---|---|
| SET stored | 202 Accepted |
200, JTI in ack |
treat as delivered |
| Duplicate JTI (already stored, ADR 0017) | 202 Accepted |
200, JTI in ack |
treat as delivered |
| SET fails parsing, signature, audience or event validation | 400 with an RFC 8935 §2.4 err (e.g. invalid_request) |
200, per-JTI entry in setErrs; the rest of the message is unaffected |
not retry that SET |
| Event store cannot durably store the SET | 503 Service Unavailable + Retry-After, body {"err":"temporarily_unavailable",...} |
503 Service Unavailable + Retry-After for the whole exchange; nothing in it is acked and no outbound SETs are returned |
resend after Retry-After |
Retry-After is I2SIG_INGEST_RETRY_AFTER seconds (default 2).
temporarily_unavailable is not an RFC 8935 §2.4 registry code; the 503
status and Retry-After header are the signal, and the code is informational.
A goSignals push transmitter classifies this response as rate-limited
back-pressure: it honours Retry-After and retries with no cap (see the table
above).
When the SSTP acceptor refuses an exchange, SETs in it that were stored before the failure are stored already. The sender resends them with the rest, they come back as duplicates, and they are acked then.
The push transmitter actively interrogates the receiver’s /status endpoint
in three situations:
When a push fails (transport or 5xx), the transmitter fetches the receiver’s
/status to disambiguate the failure:
enabled, our push still failing → continue exp backoff (it really
is a transport problem).paused → transition to local paused and enter the status-check
loop.disabled → transition to local disabled.This mirrors the poll receiver’s handleTransmitterStatus behavior.
When a node acquires a push stream’s cluster lease (see docs/Cluster.md), it
fetches the receiver’s /status before sending the first event. If the
receiver is already paused or disabled, no events are wasted — the local
side enters the matching state immediately.
This means after a node failover, a paused receiver does not get hammered with retry attempts on the new owner.
See Idle keepalive (verify events) below.
The push transmitter discovers the receiver’s /status URL via the SSF
well-known configuration (/.well-known/ssf-configuration) on the
receiver’s host. If well-known discovery fails, the transmitter falls back
to a derived URL based on the configured push endpoint (replacing the path
segment).
The status fetch reuses the same authorization the push uses.
If a push stream goes idle — no successful push for
I2SIG_PUSH_KEEPALIVE_INTERVAL (default 5 min) — the transmitter
generates a real SSF verify event as an end-to-end heartbeat:
https://schemas.openid.net/secevent/ssf/event-type/verification event
type.Operational=true).202
on success.If the verify event push fails, the failure is classified and dispatched exactly like a business event would be (T1 takes over). This is what makes the verify event a meaningful heartbeat: it tests the full delivery path (auth, signing, network, receiver), not just receiver liveness.
The idle timer is suppressed during recovery (no verify events are emitted
while the stream is in paused or actively backing off — the recovery
sub-loop is already probing the receiver via /status).
Idle state is local to the node holding the push lease. Failover resets the idle clock to “now.”
The system distinguishes business events from operational events:
Business events: SCIM, RISC, CAEP, custom event types — the actual
payload the system exists to deliver. Routed through the matcher; subject
to ResetDate/ResetJti replay.
Operational events: verification (SSF verify) and stream-updated
(SSF stream-updated). Generated for a specific stream, not routed to
other streams. Persisted for audit but excluded from operator-initiated
replay.
Operational events follow three rules:
Operational=true flag distinguishes them.iss/aud would otherwise overlap. This is a strict point-to-point
communication, consistent with the RFC8935 / SSF model where verify is
semantically a per-relationship probe.ResetDate or
ResetJti, the replay query returns only business events. Stale
operational events from prior days are not replayed — they are
operationally meaningless after the fact and would pollute a recovery
operation.If the system later introduces additional auto-generated event types, they
should be marked Operational=true and they will inherit all three
behaviors automatically.
This section walks through the three most common recovery scenarios.
disabled after RFC8935 protocol errorSymptom. A push stream is disabled. ErrorMsg contains an RFC8935
error code such as invalid_audience or authentication_failed along with
the JTI of the offending event.
What happened. The receiver explicitly rejected a SET as malformed, unauthorized, or otherwise unacceptable. The system did not retry because the same SET would produce the same error on every attempt.
How to triage:
ErrorMsg and inspect that event in the event store.authentication_failed → wrong Authorization header on push config.
Update the stream’s push delivery method and re-enable.invalid_audience → stream’s aud does not match what the receiver
expects. Update stream config and re-enable.invalid_issuer → stream’s iss does not match what the receiver
expects. Update stream config and re-enable.invalid_key / jws_signature_failed (after the single auto-retry
exhausted) → receiver’s JWKS does not have our kid. Either ask the
receiver to refresh its JWKS, or rotate to a key the receiver does
know.invalid_request → likely a malformed SET payload. Inspect the event
content; this is rare and usually points to a transmitter bug.ResetJti on the stream to skip past it.disabled after exhausting retry capSymptom. A push stream is disabled. ErrorMsg indicates the retry
cap was exceeded (e.g., “transport recovery exceeded 6h” or “401 attempts
exhausted”).
What happened. The receiver was unreachable or rejecting authorization for an extended period. The system retried with exp backoff up to the cap, then disabled the stream so the database stops accumulating un-deliverable events.
How to triage:
Symptom. The local stream’s status flips to paused then back to
enabled. No operator action was needed.
What happened. The remote receiver’s operator paused the stream from
their end. The local side detected this via /status interrogation,
stopped attempting delivery, and periodically re-checked. When the remote
re-enabled, the local side resumed automatically.
Operator action. None required. This is the system working as
designed — the paused state is transient and self-healing.
ResetDate / ResetJtiResetDate and ResetJti are fields on StreamConfiguration. They are
operator-controlled retransmission levers and are the only
mechanism in the system for replaying historical events.
| Field | Effect |
|---|---|
ResetDate |
re-mark all (business) events at-or-after this timestamp as pending |
ResetJti |
re-mark events from the named JTI forward as pending |
Both are one-shot — the server clears them after applying. Use them when:
ResetJti
to the JTI immediately after it.Operational events (verify, stream-updated) are excluded from replay.
Setting ResetDate=7-days-ago returns only business events from that
window — your recovery is not polluted with stale heartbeats.
The system never invokes ResetDate/ResetJti on its own. Auto-recovery
relies exclusively on the unacked-JTI mechanism (failed JTIs stay pending
and replay automatically when the stream re-enables).
A community deployment keeps every data event forever. Nothing in the shipped configuration ever expires a data SET. That is intentional (ADR 0055), not a defect — but it is silent, so an operator who never opts in does not find out until the collections are already large. Ping events are the one exception: they are purged 24 hours after they are stored (see below, ADR 0048).
A ping event is an SSF Verification Event, whoever sent it: an idle keepalive or an operator-triggered verify this server transmits, or one it received from a peer. Pings are diagnostic, so they are not kept forever.
events, once the body was stored longer ago than
I2SIG_PING_RETENTION (default 24h). A received ping that was never queued
to any stream is purged too. The clock is the time this server stored the
body, not the SET’s iat.maintenance:ping-purge). The lease row stores the last purge time,
so the next run is due 6 hours after it whichever node takes the lease, and
the stream-table reaper keeps that row. The first check runs 5 minutes after
start. The interval is fixed; only the retention is a setting.INFO summary of the
first runs to report many windows and large counts; later runs report about
six windows._id time (memory store: the event’s sort time). Their delivery records
carry no ping marker either. At startup, right after the
pendingEvents/deliveredEvents migration, one node (lease
migration:ping-marker) runs a one-shot backfill that marks the delivery
records of those pre-upgrade pings, in batches of 1000, and records a done
flag in the migrations collection; every later start finds the flag and
does nothing. A backfill that fails logs a WARN, does not stop the server,
and runs again at the next start. It logs
ping delivery markers backfilled marked=<n> when it marked anything. The
memory store derives the marker from the body when it loads its files.{ping:1, state:1, createdAt:1} on deliveries (ping records only) and
{receivedAt:1} on events (pings only). The server builds them at
startup, as it does every index. On a large store the first build reads the
whole collection once and takes time and I/O on the primary; build them in
a maintenance window beforehand (same keys and partial filters) to keep that
off the upgrade. The fallback query for pre-upgrade bodies uses the _id
index or the events ping index, never a collection scan.I2SIG_PING_RETENTION=0. An unparseable or negative
value logs a WARN and uses 24h.What it logs. At startup, beside the event-retention summary line:
level=INFO msg="ping retention 24h; purge every 6h, one node per cluster" component=PING-PURGE
or ping purge off (I2SIG_PING_RETENTION=0). After each run, one INFO
summary:
level=INFO msg="Ping purge complete" component=PING-PURGE deliveries=1200 bodies=1180 windows=6 duration=2.1s cutoff=...
A failed window or a lost lease logs a WARN and leaves the purge
unrecorded, so the next check retries. There are no metrics.
compact is an operator action. MongoDB
keeps the space freed by deletes inside the collection files and reuses it
for new writes, so the files do not shrink after the first-run drain. The
purge never runs compact, and neither does anything else in the server. To return the space to the volume after a large purge, run
compact on events and deliveries yourself, one replica-set member at a
time, in a maintenance window (see the MongoDB compact documentation for
its locking on your server version).Retention is resolved per stream, in days, from the retention_window_days
field on the stream state record. A nil or non-positive window means
keep-forever, and RetentionEngine.PurgeExpired skips such a stream entirely.
Two independent things hold community at keep-forever:
services.DefaultEffectiveWindow
honours only the per-stream retention_window_days override, which is unset
unless somebody set it. There is no server-wide default window and no env var
that supplies one — the finite window is expected to come from the per-stream
override, or from an enterprise resolver that folds in an enrollment-bundle
default and cap.services.NewRetentionEngine has no caller in
community. dbProviders.Persistence.EventDAO exposes the live event store
precisely so an embedder can bind one, but the community server does not. So
even a stream that does carry a window has nothing running to act on it.Because the second condition holds regardless of the first, setting a window on a community server today changes nothing about what is stored.
Both events (the global SET bodies) and deliveredEvents (the per-stream
acked index) grow monotonically. One benchmark sweep of the dev cluster — 5000
events, 16 concurrent clients — left roughly 274,000 documents in events
and 263,000 in deliveredEvents. A long-running server ingesting
continuously has no ceiling other than the volume it sits on.
retention_window_days is a goSignals operator field on the stream state
record. It is deliberately not an RFC 8935 StreamConfiguration field, and
unlike its sibling operator knobs — default_subjects, subject_filter_mode,
event_source, subject_removal_grace_seconds, event_validation — it is
not applied by StreamService.CreateStream or StreamService.UpdateStream,
and the goSignals CLI exposes no flag for it. So there is no supported
operator path in the community server: no API call, no CLI flag, no environment
variable sets it.
The field is persisted and round-trippable, so an embedder — code that links this server as a library rather than running the binary — can set it directly on the stream state record and update the stream through the DAO:
// ssfModels.StreamStateRecord.RetentionWindowDays is *int:
// nil => keep forever (the community default)
// 0 => keep forever, stated explicitly
// n>0 => retain for n days
days := 30
rec.RetentionWindowDays = &days
err := streamDAO.Update(ctx, rec)
Setting it changes what RetentionEngine.PurgeExpired would purge. It does
not by itself cause anything to expire, because no purge engine is bound in this
build — see the section above. Treat the field as forward-compatible
configuration, not as an enforcement switch.
Binding the retention engine to the running store, and with it a real operator knob, is the subject of planning issue independentid/i2gosignals-planning#75 (event-family retention, ADR 0055 Amendments 7-8). It is not part of this build.
events + deliveredEvents at your steady-state ingest rate, and alarm on
volume utilisation rather than on document counts.Check the startup line. Every server logs its retention summary once at
startup, at INFO:
level=INFO msg="Event retention summary: no purge engine is bound, so no event expires"
streams=12 keep_forever=12 windowed=0 doc=docs/operations.md#event-retention
keep_forever is the count of configured streams with no finite window.
The counts are informational: with no engine bound, windowed streams do
not expire either.
events /
deliveredEvents is unsupported and must respect the refcount rule the purge
engine encodes — a body in events may only be deleted once no stream
still references its JTI, pending or delivered. Deleting a body that a stream
still has pending loses an undelivered event.I2SIG_TOKEN_RETENTION for event retention. That variable
governs the management-plane token collection only. See
docs/configuration_properties.md.An issuer signs SETs, and the token issuer signs auth tokens, with its newest active key of the algorithm in use. Newest means the latest creation time: the server stamps one on every key record it creates, rotates or loads, and a suspend, reactivate or revoke never changes it. A record with a creation time is newer than any record without one, and records without one, or created in the same millisecond, are ordered by record id. See ADR 0028.
Key records minted by those versions carry random record ids and no creation time. Upgrading needs no migration, and nothing re-stamps existing records.
kid straight away, and every node
follows within its 2s signing-key cache expiry. Suspending the old key is no
longer needed to complete a rotation.kid; to move it to the
newer key, rotate again or suspend the old key.The push state machine is tuned via the following environment variables.
See docs/configuration_properties.md for the canonical reference and any
poll-side analogues.
| Env var | Default | Purpose |
|---|---|---|
I2SIG_PUSH_RETRY_BASE_DELAY |
1s |
Base delay for exp backoff on transport/5xx |
I2SIG_PUSH_RETRY_BACKOFF_FACTOR |
2.0 |
Multiplier per retry attempt |
I2SIG_PUSH_RETRY_MAX_DELAY |
5m |
Cap on individual sleep |
I2SIG_PUSH_RETRY_LIMIT |
6h |
Total elapsed time before transport recovery exits to disabled |
I2SIG_PUSH_AUTH_RETRY_LIMIT |
10 |
Max 401 retry attempts, and max signing-key retries, before disabled |
I2SIG_PUSH_AUTH_RETRY_DELAY |
15s |
Sleep between 401 retries, and between signing-key retries |
I2SIG_PUSH_PROBE_INTERVAL |
30s |
Cadence of /status re-checks while in paused |
I2SIG_PUSH_KEEPALIVE_INTERVAL |
5m |
Idle threshold before generating a verify-event keepalive |
The existing I2SIG_PUSH_BACKFILL_INTERVAL and
I2SIG_PUSH_BACKFILL_BATCH continue to govern active-mode buffer
refilling — they are independent of the recovery state machine and remain at
their previous defaults.
Cluster lease ownership (#364) is tuned by one variable:
| Env var | Default | Purpose |
|---|---|---|
I2SIG_LEASE_SAFETY_MARGIN |
5s |
How long before a lease’s recorded expiry a node stops acknowledging as its owner (Go duration). It covers clock drift and the time an acknowledgement batch takes to reach the store. A value over half the lease duration is capped at half (15s for the 30s production leases) and logged once at WARN; a negative value is treated as 0 and logged at WARN; an unparsable value falls back to the default |
(C)2026 Independent Identity Inc.