Files
PaperClipAI/server
nickyleachandPaperclip 6e7f3cc9b0 fix(server): preserve the task-drain termination deadline across a failed swap, and retry its audit write
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>
2026-09-16 07:49:30 +00:00
..