Skip to content

Multiple instances: respect another instance's in-progress claim and never remove its processing label #3892

Backlog

Description

@integry

Problem

Two ProPR instances that monitor the same repository both process the same issue. The second one also removes the first one's in-progress label.

Seen on 2026-11-29. A second instance (a Fly test instance enrolled with the shared ProPR App) monitored integry/propr-site alongside the owner's main instance. Timeline for integry/propr-site#266:

  • 21:59:04: the owner labels it AI.
  • 21:59:10: the main instance adds AI-processing and posts "AI processing has started … codex / gpt-6.2-sol". Its run continues normally.
  • 22:01:27: the second instance's initial repository scan claims the same issue and posts its own "AI processing has started … claude-opus-5-5".
  • 22:03:14: the second instance's run fails, and it removes AI-processing, the label the main instance added and still depends on.

Any setup with more than one instance on the same GitHub App installation can hit this, for example a Fly instance next to a self-hosted one, or a staging instance next to production. With working runtimes, both instances would open competing PRs for one issue.

Expected

  1. Respect an existing claim. An instance doesn't start an issue or PR follow-up that already carries the in-progress label (AI-processing or the configured processing tag), unless this instance holds the claim itself. That covers polling, webhook intake and the initial repository scan. A claim older than a configurable stale threshold, with no live activity, may be taken over, with a log line and a comment naming the takeover.
  2. Only remove labels you added. On failure, cancellation or completion, an instance removes the processing label only if it holds the claim. Track it locally, or add a per-instance marker (e.g. an instance id in the hidden metadata of the "processing started" comment) so a restart doesn't lose it.
  3. Make the claim atomic. Narrow the race between "check label" and "add label" as far as GitHub allows: add the label, then re-read the labels and the earliest claiming comment, and back off if another instance claimed first.
  4. Surface it. When an instance skips an issue another instance claimed, log it with that instance's id if known, and show it in the dashboard's attention area.

Acceptance

  • Tests: issue already labeled AI-processing → no claim and no comment. Two instances racing → exactly one proceeds. A run that fails or is cancelled on instance B never removes A's label. A stale claim is taken over only past the threshold.
  • Docs: a note on running several instances against one installation (separate repository lists are still recommended, and the overlap behavior is described).

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions