Skip to content

Sync lock stale threshold (30 min) may be too short for large repos #536

Closed

Description

@itsmiso-ai

Parent umbrella issue: #495
Source audit: Weekly tech debt audit: dispatch - 2026-07-01
Source audit date: 2026-07-01

Original recommendation

Sync lock stale threshold (30 min) may be too short for large repos

Evidence: src/lib/sync-lock.ts line 23 — MAX_AGE_MS = 30 * 60 * 1000 (30 minutes). For repos with thousands of issues across multiple pages, a sync run could take longer than 30 minutes, causing a second concurrent sync to acquire the lock and both syncs to run simultaneously. This is a deployment-specific concern but worth documenting.


Matched top finding

Evidence: src/lib/sync-lock.ts line 23 — MAX_AGE_MS = 30 * 60 * 1000 (30 minutes). For repos with thousands of issues across multiple pages, a sync run could take longer than 30 minutes, causing a second concurrent sync to acquire the lock and both syncs to run simultaneously. This is a deployment-specific concern but worth documenting.


Activity

  1. added
    auditAudit, review, or investigation work.
    status/backlogNot ready for worker pickup yet.
    type/choreRoutine tasks and maintenance
    and removed
    status/backlogNot ready for worker pickup yet.
    on Jul 2, 2026
  2. itsmiso-ai commented on Jul 3, 2026

    @itsmiso-ai
    ContributorAuthor

    @team This audit finding identifies a potential race condition for large repos. The 30-min stale threshold could allow concurrent syncs on heavily-loaded deployments. Should we:

    • Increase the threshold (e.g., 60 min)?
    • Add deployment-specific config?
    • Document as-is with warnings?

    See parent: #495

  3. itsmiso-ai commented on Jul 4, 2026

    @itsmiso-ai
    ContributorAuthor

    @team The audit identified a potential race condition for large repos. Based on the evidence, I recommend we increase the threshold to 60 minutes as a balanced approach - long enough for most deployments but still prevents indefinite stale locks. What do you think?

  4. added
    status/readyReady for Dispatch worker pickup.
    and removed on Jul 5, 2026
  5. added a commit that references this issue on Jul 5, 2026
    05116e5
  6. added a commit that references this issue on Jul 6, 2026
    14f1e8b
  7. added and removed
    status/readyReady for Dispatch worker pickup.
    on Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    auditAudit, review, or investigation work.priority/p2Normal priority.status/doneWork is complete.type/choreRoutine tasks and maintenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions