Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

[Backport 5.2] Embeddings: avoid constantly rerunning job if it failed#59090

Merged
camdencheek merged 5 commits into
5.2from
jtibs/embeddings
Jan 9, 2024
Merged

[Backport 5.2] Embeddings: avoid constantly rerunning job if it failed#59090
camdencheek merged 5 commits into
5.2from
jtibs/embeddings

Conversation

@jtibshirani

Copy link
Copy Markdown
Contributor

This PR backports a fix to embeddings, plus an earlier refactor that it's based on:

Test plan

Modified unit tests

Refactors the repository scheduling logic into two separate methods, one used
by the GraphQL API, and the other by the policy framework. This makes the code
easier to read and lets us make some improvements:
* For policy scheduling, stop translating back-and-forth between repo IDs and
names
* Make sure to fail entire GraphQL request if there is an error fetching repos,
instead of silently ignoring it

## Test plan

Added new unit test
The embeddings policy framework attempts to rerun a repo job even if a previous
run failed at the exact same revision. This means that when a job failed, for
example because of rate limits or a problematic file, it would immediately be
rescheduled and fail again. This can be expensive and noisy.

Now, the policy framework does **not** rerun failed jobs unless the revision
changes. An admin can always kick off a job manually if they want to rerun a
job at the revision. This reduces noise and feels like a better trade-off.
@cla-bot cla-bot Bot added the cla-signed label Dec 18, 2023
@jtibshirani jtibshirani requested a review from a team December 18, 2023 21:01
@sourcegraph-bot

sourcegraph-bot commented Dec 18, 2023

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff 08620a8...995489a.

Notify File(s)
@efritz enterprise/cmd/worker/internal/embeddings/repo/scheduler.go

@sourcegraph-bot

sourcegraph-bot commented Dec 18, 2023

Copy link
Copy Markdown
Contributor

📖 Storybook live preview

@jtibshirani jtibshirani requested a review from a team January 9, 2024 01:45
@camdencheek camdencheek merged commit 09e5b7f into 5.2 Jan 9, 2024
@camdencheek camdencheek deleted the jtibs/embeddings branch January 9, 2024 16:56
@varungandhi-src varungandhi-src mentioned this pull request Jan 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants