-
Notifications
You must be signed in to change notification settings - Fork 15
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
WIP: ability to kick failed jobs back onto queue. #3
Conversation
Scenario with job timing out: Fresh job: |
Scenario with job failing: Fresh job: |
t, err := job.Timeouts() | ||
if err != nil { | ||
b.log.Panic(err) | ||
} | ||
if t >= TimeoutTries { | ||
b.log.Printf("job %d has %d timeouts, burying", job.Id, t) | ||
if (t - kicks) >= TimeoutTries { |
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 reckon this condition and the one on L130 should be pulled out into predicate methods as intent isn't super clear
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.
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.
Ah sorry, should have paid more attention to subject line.
So, the only weird case here is if a task has been buried a few times because it was failing, and it then times out: New job: Fails until buried: Is kicked: Fails again, kicked again: It now times out: Reserved again: Job runs, eventually either timeouts or releases reaches the threshold. Is this even a big deal though? (edited by @pda) |
Side-note: if we use this approach, some things need to be treated as signed integers. |
Background: #2
TL;DR: kicking failed jobs causes them to be instantly re-buried based on their stats.
This change means each
kick
buys a job one morerelease
ortimeout
before it's auto-buried./cc @lwc.
For reference, here's a sample
stats-job
output: