Tendrl / api

Tendrl API
GNU Lesser General Public License v2.1
16 stars 16 forks source link

Load_all function required job_id in job which is created by API #433

Closed GowthamShanmugam closed 5 years ago

GowthamShanmugam commented 6 years ago

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.

GowthamShanmugam commented 5 years ago

This issue is fixed