Hello folks at Rosen,
I noticed that if a Guard stops at the wrong moment while completing a transaction, its event can stay stuck in that Guard's database.
When a transaction is confirmed, the Guard first sets it to completed and then, in a separate write, moves its event to pending-reward or completed, or its order to completed (transactionProcessor). If the process or database fails between the two, the next start does not pick the transaction up again, because getActiveTransactions skips completed ones (databaseAction).
Nothing else moves the event or order on. TimeoutLeftoverEvents only looks at pending-payment events (eventProcessor), timeoutLeftoverOrders only looks at pending orders (arbitraryProcessor), and reprocess does not accept in-payment or in-reward. So the event stays in-payment or in-reward, or the order stays in-process.
For a payment on a chain other than Ergo, this means that Guard never approves the event's reward transaction, because the event is not pending-reward (requestVerifier). In the other cases the Guard just shows the wrong status. It stays this way until someone fixes its database by hand. The window is small, but a restart or a database error at that moment is enough.
Keep up the Great Work,
Phroi
Hello folks at Rosen,
I noticed that if a Guard stops at the wrong moment while completing a transaction, its event can stay stuck in that Guard's database.
When a transaction is confirmed, the Guard first sets it to
completedand then, in a separate write, moves its event topending-rewardorcompleted, or its order tocompleted(transactionProcessor). If the process or database fails between the two, the next start does not pick the transaction up again, becausegetActiveTransactionsskipscompletedones (databaseAction).Nothing else moves the event or order on.
TimeoutLeftoverEventsonly looks atpending-paymentevents (eventProcessor),timeoutLeftoverOrdersonly looks atpendingorders (arbitraryProcessor), and reprocess does not acceptin-paymentorin-reward. So the event staysin-paymentorin-reward, or the order staysin-process.For a payment on a chain other than Ergo, this means that Guard never approves the event's reward transaction, because the event is not
pending-reward(requestVerifier). In the other cases the Guard just shows the wrong status. It stays this way until someone fixes its database by hand. The window is small, but a restart or a database error at that moment is enough.Keep up the Great Work,
Phroi