mirror of
https://github.com/corda/corda.git
synced 2025-02-21 09:51:57 +00:00
Flows that are kept for overnight observation: - Save their Checkpoint.status as 'HOSPITALIZED' in the database - Save the error that caused the hospitalization in the database A new Event was added for this reason. Whenever the hospital determines a flow for hospitalization, it adds this Event in the flow's fiber queue. When processed it creates a new DB transaction, stores the checkpoint status along with the error, and it adds a 'FlowContinuation.ProcessEvents' continuation so that the fiber keeps processing events (effectively since there are no more events in the fiber's channel, the fiber will suspend). Flows that error: - Their checkpoints are kept in the database - Save their Checkpoint.status as 'FAILED' - Save the error that caused the error in the database Upon erroring, the flow's Checkpoint.status gets updated('FAILED') and the checkpoint is stored in the database instead of getting removed. The flow then propagates the error to counterparties, sets its future with the error and gets removed from memory.