Skip to main content

Module lifecycle_reason

Module lifecycle_reason 

Source
Expand description

Structured lifecycle reason helpers.

Transport libraries still surface close reasons as debug strings in several places, but runtime policy should branch on reason codes rather than ad-hoc substring checks scattered through the codebase.

Enums§

LifecycleReasonCode

Constants§

REASON_APP_BACKGROUNDED
REASON_AUTO_CONNECT_FAILURE
REASON_CLOSED
REASON_CONNECTION_FAILED_STABILITY
REASON_DESIRED_PEER_WITHDRAWN
The authoritative coordination roster removed this peer. This is a terminal close for the current session, but it is not a user/manual disconnect and must not suppress a later fresh admission.
REASON_DISCONNECTED_BY_USER
REASON_DUPLICATE_ACCEPT_SUPERSEDED
REASON_DUPLICATE_DIAL_SUPERSEDED
REASON_DUPLICATE_KEPT_EXISTING
REASON_ENDPOINT_HARD_RESET_REDIAL
REASON_INCOMING_TRANSPORT_CLOSED_WITHOUT_LIVE_REPLACEMENT
REASON_MANUAL_DISCONNECT
REASON_NATIVE_CUSTOM_TRANSPORT_UPGRADE
The native node emits this when an authenticated transport-upgrade control exchange replaces the current Iroh leg with a selected custom transport. The old leg’s close is expected replacement churn, not a terminal loss.
REASON_NETWORK_CHANGE_RECONNECT
REASON_REMOTE_MANUAL_DISCONNECT
REASON_REPLACED_BY_FRESH_INCOMING
REASON_REPLACED_BY_NEW_INBOUND
REASON_REPLACED_BY_NEW_OUTBOUND
Emitted by native_node::connect / connect_addr when a fresh outbound dial replaces an earlier connection to the same endpoint (mirror of REASON_REPLACED_BY_NEW_INBOUND for the dialer side). Must be classified as replacement churn — without it, glare resolution retires the kept transport with incoming-transport-closed-without-live-replacement even though a fresher replacement is already adopted.
REASON_REPLACEMENT_IN_PROGRESS
REASON_REPLACEMENT_PEER_ADMITTED
REASON_RETIRED_CONFLICTING_RECORD
REASON_SESSION_ADMISSION_REJECTED
REASON_SESSION_TOKEN_REVOKED
REASON_STALE_ACTIVE_CONNECTION_RECONNECT
REASON_STALE_SETTLED_PEER_SNAPSHOT
REASON_ZOMBIE_REPLACED_BY_FRESH_ACCEPT
REASON_ZOMBIE_REPLACED_BY_FRESH_DIAL

Functions§

reason_is_graceful_disconnect
reason_is_manual_disconnect
reason_is_replacement_churn
reason_is_terminal_disconnect
reason_is_transient_reconnect