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 crash on missing job #146

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fix crash on missing job #146

wants to merge 2 commits into from

Conversation

bstriner
Copy link

Hi guys,

The jobManager was occasionally crashing on makeDead.

"'NoneType' object has no attribute 'id'" on the line including makeDead.

If the job is None, that must mean that getNextPendingJobReuse returned a job id that jobqueue.get couldn't get.

Anyways, this exception was happening in the except block so actually killed the jobManager. Added an if statement to avoid the crash. Would maybe be better to have an inner try block just to make the thing more resilient.

Doesn't address the core problem of why the job is missing, but fixes my problems for now.

Cheers!

@bstriner
Copy link
Author

Would something like this make sense? Try to invalidate the original job when getNextPendingJobReuse fails.

id, vm = self.jobQueue.getNextPendingJobReuse(id)
if id is None:
  self.jobQueue.makeDead(job.id, "getNextPendingJobReuse failed")
  continue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants