You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
peering: retry serialization failures (40001) in invoice settlement #1154
Peering settlement runs inside a serializable transaction
(src/database/transaction.ts), but neither the callback path nor the worker
retry path handles PostgreSQL 40001 (serialization_failure).
confirmInvoice (src/services/payments-service.ts) begins a serializable transaction that updates the invoice and the peering row.
A concurrent writer can abort it with SQLSTATE 40001.
Nothing retries the transaction. The error propagates, so the callback reports failure even though the payment is valid.
Access is eventually recovered: findUnconfirmedPeeringInvoices (src/repositories/invoice-repository.ts) finds the completed invoice with confirmed_at = null, and the maintenance worker retries it on a later pass.
Recovery keeps the peer from being stranded, but the immediate check fails and settlement latency depends on the next maintenance pass.
Expected
A bounded retry on serialization conflicts, without retrying deterministic failures (missing peer row, missing term snapshot, underpayment).
Activity