Skip to content
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 logic in attempts remaining check #742

Merged
merged 1 commit into from
Nov 4, 2015
Merged

Conversation

parkan
Copy link
Contributor

@parkan parkan commented Nov 2, 2015

A race condition in our app was causing some jobs to be failed twice, bringing Job._attempts below 0, which resulted in the truthiness check -1 ?... below passing and the job being retried indefinitely. I'm still trying to track down the race condition, but this fix appears to prevent that behavior.

@behrad
Copy link
Collaborator

behrad commented Nov 2, 2015

I've also seen the same, some race is causing more than max attempts (unlimited attempts even for failing jobs). Would you please investigate more to see if it still happens?
I was thinking if using .ttl for jobs that are failing can increase the potential for this :)

Thank you @parkan

@behrad behrad added the Bug label Nov 2, 2015
@parkan
Copy link
Contributor Author

parkan commented Nov 2, 2015

Yeah, empirically this seems to happen with jobs that are likely to fail after an unclear amount of time (http requests against old links) and TTL being set

behrad added a commit that referenced this pull request Nov 4, 2015
Fix logic in attempts remaining check
@behrad behrad merged commit 2addace into Automattic:master Nov 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants