Tendrl / commons

Common code usable by all Tendrl components

Home Page:http://www.tendrl.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Job sync thread will fail after /queue directory becomes empty

GowthamShanmugam opened this issue · comments

Each job in /queue directory has TTL for two days. When all the jobs in a /queue directory are deleted by TTL then sync thread in all tendrl components are failing with error:

Jun 18 15:31:34 tendrl-server tendrl-monitoring-integration[6703]: Traceback (most recent call last):
Jun 18 15:31:34 tendrl-server tendrl-monitoring-integration[6703]: File "/usr/lib64/python2.7/threading.py", line 812, in __bootstrap_inner
Jun 18 15:31:34 tendrl-server tendrl-monitoring-integration[6703]: self.run()
Jun 18 15:31:34 tendrl-server tendrl-monitoring-integration[6703]: File "/usr/lib64/python2.7/threading.py", line 765, in run
Jun 18 15:31:34 tendrl-server tendrl-monitoring-integration[6703]: self.__target(*self.__args, **self.__kwargs)
Jun 18 15:31:34 tendrl-server tendrl-monitoring-integration[6703]: File "/usr/lib/python2.7/site-packages/tendrl/commons/jobs/init.py", line 84, in process_job
Jun 18 15:31:34 tendrl-server tendrl-monitoring-integration[6703]: job.save()
Jun 18 15:31:34 tendrl-server tendrl-monitoring-integration[6703]: File "/usr/lib/python2.7/site-packages/tendrl/commons/objects/job/init.py", line 23, in save
Jun 18 15:31:34 tendrl-server tendrl-monitoring-integration[6703]: if "parent" in self.payload:
Jun 18 15:31:34 tendrl-server tendrl-monitoring-integration[6703]: TypeError: argument of type 'NoneType' is not iterable

In this case, the empty directory is different and directory not found is different, In fresh machine /queue directory not present, But that time everything is working fine. Problem is when directory present but it contains not jobs.

This issue is fixed