Prevent duplicate publish/audit submissions in the web process #101

Closed
opened 2026-10-05 12:50:13 +00:00 by eleith · 0 comments
Owner

Goal

Prevent duplicate Publish/PublishAudit submissions within the current single-web-process setup.

The existing check and enqueue are separate asynchronous operations, so two requests can both pass the idle check. The worker currently executes one job at a time; this work targets duplicate admission rather than adding distributed execution controls.

Scope

  • Allow only one web request at a time through the shared publish/audit check-and-enqueue operation.
  • Query all pending/running Publish and PublishAudit runs, not only the latest run of each type.
  • Preserve the conflict response identifying the existing run and the audit freshness/consumption checks.
  • Release the local admission guard when enqueue fails; persisted queue state remains the source for in-flight checks after restart.
  • Test simultaneous Publish/Publish, Publish/Audit and Audit/Audit requests, plus an older in-flight run hidden by a newer terminal run.

This is a single-web-process guarantee. Cross-process locks, database claim/lease schemas, and independent producers are outside scope.

## Goal Prevent duplicate Publish/PublishAudit submissions within the current single-web-process setup. The existing check and enqueue are separate asynchronous operations, so two requests can both pass the idle check. The worker currently executes one job at a time; this work targets duplicate admission rather than adding distributed execution controls. ## Scope - Allow only one web request at a time through the shared publish/audit check-and-enqueue operation. - Query all pending/running Publish and PublishAudit runs, not only the latest run of each type. - Preserve the conflict response identifying the existing run and the audit freshness/consumption checks. - Release the local admission guard when enqueue fails; persisted queue state remains the source for in-flight checks after restart. - Test simultaneous Publish/Publish, Publish/Audit and Audit/Audit requests, plus an older in-flight run hidden by a newer terminal run. This is a single-web-process guarantee. Cross-process locks, database claim/lease schemas, and independent producers are outside scope.
eleith added the bug label 2026-10-05 12:50:13 +00:00
eleith changed title from Make Publish and PublishAudit admission mutually exclusive atomically to Prevent duplicate publish/audit submissions in the web process 2026-10-05 23:10:37 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: eleith/luzzle#101