Skip to content

[Bug] Bug report: worktree PR-status polling can hammer (and OOM) a self-hosted forge #8807

Closed

Description

@orca-discord-issues

Terra Terra via Discord

Orca resolves each worktree's branch to its PR by paginating GET /repos/{repo}/pulls?state=all&sort=recentupdate&page=N&limit=50 (up to MAX_PULL_REQUEST_PAGES = 5) and filtering client-side, with a 5 second request timeout.

On my self-hosted Forgejo repo with ~240 PRs this is rough:

  • Any worktree branch with no PR scans all 5 pages (250 PRs) before giving up, on every card refresh, per worktree.
  • Forgejo's PR-list endpoint is slow (~5s per page of 50, it loads reviewer data per PR), so Orca's 5s timeout cancels right as the server finishes and the work gets thrown away and retried.
  • Steady state was about 1 request/min; a push event refreshed all my worktree cards at once and the burst OOM-killed my Forgejo pod (512Mi limit) into a crash loop. I've bumped the limit, but Orca was the trigger.

Suggested fixes: query state=open instead of state=all (lazy fallback for merged detection), share one scan per repo across worktrees instead of per-card, cache negative results, and/or raise the timeout above 5s so completed responses aren't discarded. Root annoyance: the Gitea/Forgejo API has no head branch filter like GitHub's, so some scan is unavoidable, but it can be much cheaper.

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions