Skip to content

fix(jobscheduler): drop jobs already waiting in the same queue - #451

Merged
joshfriend merged 1 commit into
mainfrom
jfriend/dedupe-scheduler-queue
Nov 16, 2026
Merged

joshfriend merged 1 commit into
mainfrom
jfriend/dedupe-scheduler-queue

Conversation

@joshfriend

Copy link
Copy Markdown
Contributor

Every ref request that finds a mirror stale submits a fetch, and fetches for a repo run one at a time. During work hours busy repos like cash-server get requests faster than a fetch finishes, so production pods built up hundreds of identical queued fetches that only drained overnight.

The scheduler now drops a job when one with the same queue and id is already waiting, so each repo has at most one running and one waiting copy. TrySubmit treats a waiting duplicate as accepted.

@joshfriend
joshfriend requested a review from a team as a code owner November 16, 2026 20:30
@joshfriend
joshfriend requested review from stuartwdouglas and removed request for a team November 16, 2026 20:30
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T20:35:04.165715Z 9448fb0 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ca72a6aa60

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/jobscheduler/jobs.go Resolved
Stale ref checks submit a fetch per request, and the fetch queue runs them one at a time, so busy repos piled up hundreds of identical fetches.
@joshfriend
joshfriend force-pushed the jfriend/dedupe-scheduler-queue branch from ca72a6a to 9448fb0 Compare November 16, 2026 20:33
@joshfriend
joshfriend merged commit aca25b1 into main Nov 16, 2026
7 checks passed
@joshfriend
joshfriend deleted the jfriend/dedupe-scheduler-queue branch November 16, 2026 20:41
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.

2 participants