Skip to content

HYDI-45: Prevent duplicate scheduler dispatches#41

Draft
oz-by-warp[bot] wants to merge 2 commits into
mainfrom
agent/HYDI-45
Draft

HYDI-45: Prevent duplicate scheduler dispatches#41
oz-by-warp[bot] wants to merge 2 commits into
mainfrom
agent/HYDI-45

Conversation

@oz-by-warp
Copy link
Copy Markdown
Contributor

@oz-by-warp oz-by-warp Bot commented Jun 2, 2026

Implements HYDI-45

Changes

  • Replaced setInterval scheduler ticking with self-scheduling setTimeout that waits for each cycle to finish before scheduling the next.
  • Added atomic queue-claiming via claimRunForSpawn(ticketKey) and safe rollback via releaseSpawnClaim(ticketKey) so only one scheduler cycle can dispatch a queued ticket.
  • Guarded upsertDispatchRun conflict updates to block stale queued writes from downgrading running/succeeded rows.
  • Added scheduler tests for atomic claim behavior and non-overlapping scheduler cycles.
  • Added DB integration coverage for guarded upsert and claim/release semantics.
  • Updated architecture, Jira integration, and database docs to reflect the race-condition protections.

Validation

  • npm test
  • npm run typecheck
  • npm run test:coverage

Co-Authored-By: Oz oz-agent@warp.dev

Conversation: https://app.warp.dev/conversation/63c3fd0f-052b-4002-b317-adc91ea63ec2
Run: https://oz.warp.dev/runs/019e88b9-35b2-754d-b5fc-2e265d53ffd0

This PR was generated with Oz.

Co-Authored-By: Oz <oz-agent@warp.dev>
@hyperbolic-coolify
Copy link
Copy Markdown

hyperbolic-coolify Bot commented Jun 2, 2026

The preview deployment for hyper-dispatch is ready. 🟢

Open Preview | Open Build Logs | Open Application Logs

Last updated at: 2026-06-02 14:34:59 CET

Co-Authored-By: Oz <oz-agent@warp.dev>
@oz-by-warp oz-by-warp Bot changed the title HYDI-45: Prevent scheduler double-dispatch race condition HYDI-45: Prevent duplicate scheduler dispatches Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant