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

[Backport 5.2] Embeddings: fail job immediately if rate limited exceeded#58939

Merged
jdpleiness merged 1 commit into
5.2from
jtibs/embeddings
Dec 13, 2023
Merged

[Backport 5.2] Embeddings: fail job immediately if rate limited exceeded#58939
jdpleiness merged 1 commit into
5.2from
jtibs/embeddings

Conversation

@jtibshirani

@jtibshirani jtibshirani commented Dec 12, 2023

Copy link
Copy Markdown
Contributor

Usually, during an embeddings job we allow 10% of embedding requests to fail,
simply skipping over failed chunks. If a customer has hit their rate limits,
this means we might continually send a huge number of embedding requests that
we know will immediately fail. With this change, we immediately fail a job if
the rate limit is exceeded.

It also increases the amount of time between attempting to run a job to 15
minutes. This won't make a big difference to user experience, since by default
embeddings jobs aren't allowed to be scheduled within 24h of the last run. But
it helps prevent jobs from continuously being scheduled then failing.

This change is unlikely to have a user-facing impact, but just helps cut down
on noise in logs and excessive requests to Cody Gateway.

Backport for https://github.com/sourcegraph/sourcegraph/pull/58869

Test plan

Added new unit test

Usually, during an embeddings job we allow 10% of embedding requests to fail,
simply skipping over failed chunks. If a customer has hit their rate limits,
this means we might continually send a huge number of embedding requests that
we know will immediately fail. With this change, we immediately fail a job if
the rate limit is exceeded.

It also increases the amount of time between attempting to run a job to 15
minutes. This won't make a big difference to user experience, since by default
embeddings jobs aren't allowed to be scheduled within 24h of the last run. But
it helps prevent jobs from continuously being scheduled then failing.

This change is unlikely to have a user-facing impact, but just helps cut down
on noise in logs and excessive requests to Cody Gateway.
@cla-bot cla-bot Bot added the cla-signed label Dec 12, 2023
@sourcegraph-bot

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff 021f43a...789532c.

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

@sourcegraph-bot

Copy link
Copy Markdown
Contributor

📖 Storybook live preview

@jtibshirani jtibshirani requested a review from a team December 12, 2023 20:08
@jtibshirani jtibshirani added the backport/improvement Final touching of existing features label Dec 12, 2023
@jdpleiness jdpleiness requested a review from a team December 13, 2023 18:57
@jdpleiness jdpleiness merged commit 1e2545b into 5.2 Dec 13, 2023
@jdpleiness jdpleiness deleted the jtibs/embeddings branch December 13, 2023 18:57
@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.

Labels

backport/improvement Final touching of existing features cla-signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants