The problem in current approach is jobs are directly read from /queue directory from etcd. (https://github.com/Tendrl/commons/blob/master/tendrl/commons/jobs/__init__.py#L53)
Here when all jobs are deleted by TTL after few days then sync thread in all tendrl components are failing. It is happening because of direct read gives the same key when we read the empty directory. )(e.g) if /queue directory is present but if it is empty then etcd_utils.read("/queue").leaves gives same key /queue as result.
So because of this, all sync threads are failing. This problem is actually handled in load_all function, and better we use load_all function instead doing direct read.
But the problem in job().load_all() is it required job_id in job json when API creates a job in etcd.
The problem in current approach is jobs are directly read from /queue directory from etcd. (https://github.com/Tendrl/commons/blob/master/tendrl/commons/jobs/__init__.py#L53) Here when all jobs are deleted by TTL after few days then sync thread in all tendrl components are failing. It is happening because of direct read gives the same key when we read the empty directory. )(e.g) if /queue directory is present but if it is empty then etcd_utils.read("/queue").leaves gives same key /queue as result.
So because of this, all sync threads are failing. This problem is actually handled in load_all function, and better we use load_all function instead doing direct read.
But the problem in job().load_all() is it required job_id in job json when API creates a job in etcd.