mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-25 17:45:53 +01:00
A repeated drain start, or a drain stop, cleared the termination timer before it knew whether its own audit write would succeed. A failure after that clear left the prior, still-live drain with no timer, so an active run could survive its advertised deadline. Snapshot the armed termination before the clear and re-arm it if the replacement fails. The deadline handler also committed run cancellations before it wrote the outcome audit record. A failure in the company list read or the audit transaction after that point silently dropped the record for an already-irreversible action. Retry that step on a transient database connection drop, and log the full outcome when the retries do not recover it, so the result stays recoverable. Co-authored-by: Paperclip <noreply@paperclip.ing>