About Intents Expiry
Date | Responsible | Changes |
---|---|---|
July 31, 2023 | @Branko Durdevic | Initial version |
Introduction
A lot can happen during processing of an intent that can cause it to pause temporarily or even stop completely, especially when communicating with outside services like bridges. If an intent is not processed in time for whatever reason, it will be expired. This means that processing will never be finished and the intent will be aborted. As a consequence, the entire thread that the intent is a part of will also be aborted.
Processing
Ledger continuously monitors the system for expired intents looking at the created moment which is the custom.moment
of the signature with custom.status = 'created'
. If an intent has no created moment, it will not be aborted as part of the expiration process. If the elapsed time is greater than the threshold and the intent is still in pending
status, the entire thread is aborted which means all the intents will get an aborted
signature with core.intent-expired
reason and end up in the aborted
status. An intent that is not pending
, but still not in a final status like completed
or rejected
(eg. if it is committed
), will not be expired.
An intent is not guaranteed to be aborted if it is expired, it only becomes eligible to be aborted and will be picked up by the next iteration of the expiry process. This process is run constantly, but it is still possible that intent processing continues between becoming expired and getting picked up by the process.
The expiry signature is of the form:
Configuration
To configure expiry, the data.config.intentExpiryThresholdMinutes
property needs to be set to the number of minutes after which an intent should be expired.