Skip to content

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