diff --git a/apps/api/internal/store/admission_queue.go b/apps/api/internal/store/admission_queue.go index 21426ed..0392c0c 100644 --- a/apps/api/internal/store/admission_queue.go +++ b/apps/api/internal/store/admission_queue.go @@ -151,6 +151,16 @@ func (s *Store) queueTaskAdmissionOnce( return TaskAdmission{}, err } defer rollbackTransaction(tx) + // The task itself was synchronously committed before this derived FIFO + // registration. Do not serialize a large media burst on one cross-region + // synchronous commit per waiting row: PostgreSQL still writes this WAL + // locally, and generic queued-task recovery reconstructs a registration + // after failover if the small asynchronous-commit window is hit. Admission, + // River job, execution lease, task state, and billing commits stay fully + // synchronous. + if _, err := tx.Exec(ctx, `SET LOCAL synchronous_commit = off`); err != nil { + return TaskAdmission{}, err + } if err := tryAdmissionTransactionLock(ctx, tx, "task-admission:"+input.TaskID); err != nil { return TaskAdmission{}, err