-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: jobs not draining as fast as we'd like because of rate-limiting etc. #4327
Conversation
Important Auto Review SkippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the To trigger a single review, invoke the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
20ec5c7
to
a942ba6
Compare
28d2967
to
67efbd4
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #4327 +/- ##
==========================================
- Coverage 74.02% 74.02% -0.01%
==========================================
Files 381 381
Lines 54404 54419 +15
==========================================
+ Hits 40272 40282 +10
- Misses 11849 11853 +4
- Partials 2283 2284 +1 ☔ View full report in Codecov by Sentry. |
3dd9f84
to
2de63d1
Compare
router/handle.go
Outdated
@@ -579,7 +585,7 @@ func (rt *Handle) findWorkerSlot(ctx context.Context, workers []*worker, job *jo | |||
return nil, types.ErrBarrierExists | |||
} | |||
rt.logger.Debugf("EventOrder: job %d of orderKey %s is allowed to be processed", job.JobID, orderKey) | |||
if rt.shouldThrottle(ctx, job, parameters) { | |||
if rt.shouldThrottle(ctx, job, parameters) && !abortedJob { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we check if we should throttle before entering the barrier like we do for backoff?
Something like:
- if shouldBackoff AND !abortedJob THEN return ErrJobBackoff
- if shouldThrottle AND !abortedJob THEN return ErrDestinationThrottled
- get worker slot
- enter barrier THEN return (ErrBarrierExists OR slot)
Wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this order(barrier.Enter
and then checking if throttled
) is being followed for a reason(can't think of one right now).
@atzoum wdyt?
2de63d1
to
326f04b
Compare
ad757d6
to
bb61082
Compare
Co-authored-by: Francesco Casula <fracasula@users.noreply.github.com>
219e603
to
865d74a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Drain router jobs faster. Done by sending the job to worker in case of backoff or throttling whereas it was discarded earlier.
Linear Ticket
slack thread
Resolves PIPE-713
Security