Tendrl / commons

Common code usable by all Tendrl components
http://www.tendrl.org
GNU Lesser General Public License v2.1
4 stars 23 forks source link

Job sync thread will fail after /queue directory becomes empty #993

Closed GowthamShanmugam closed 5 years ago

GowthamShanmugam commented 6 years ago

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

GowthamShanmugam commented 6 years ago

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.

GowthamShanmugam commented 6 years ago

Tendrl/api/issues/433

GowthamShanmugam commented 5 years ago

This issue is fixed