diff --git a/src/master/httprest.py b/src/master/httprest.py index cb2d00e..abbdb10 100755 --- a/src/master/httprest.py +++ b/src/master/httprest.py @@ -803,6 +803,8 @@ def add_job(user,beans,form): 'message': 'add batch job success' } for key in job_data: + if key == 'csrf_token': + continue key_arr = key.split('_') value = job_data[key] if key_arr[0] == 'srcAddr' and value == '': diff --git a/src/master/jobmgr.py b/src/master/jobmgr.py index e758d79..d9d6e11 100644 --- a/src/master/jobmgr.py +++ b/src/master/jobmgr.py @@ -22,7 +22,10 @@ class BatchJob(object): def top_sort(self): logger.debug('top sorting') tasks = self.raw_job_info["tasks"] + logger.debug('top sorting test') dependency_graph = {} + logger.debug('top sorting test2') + logger.info(tasks) for task_idx in tasks: dependency_graph[task_idx] = set() task_info = tasks[task_idx] @@ -33,6 +36,7 @@ class BatchJob(object): if not t in tasks: raise ValueError('task %s is not defined in the dependency of task %s' % (t, task_idx)) dependency_graph[task_idx].add(t) + logger.debug('top sorting end') while len(dependency_graph) > 0: s = set() flag = False @@ -54,6 +58,7 @@ class BatchJob(object): 'task_idx': s, 'status': 'pending' }) + logger.debug('top sorting return') # get a task and pass it to taskmgr def get_task(self): @@ -89,11 +94,15 @@ class JobMgr(threading.Thread): # user submit a new job, add this job to queue and database def add_job(self, user, job_info): try: + logger.info(self.job_queue) job = BatchJob(user, job_info) + logger.info("test2") job.job_id = self.gen_jobid() + logger.info("test3") self.job_queue.append(job.job_id) self.job_map[job.job_id] = job except ValueError as err: + logger.error(err) return [False, err.args[0]] except Exception as err: return [False, err.args[0]] @@ -104,6 +113,7 @@ class JobMgr(threading.Thread): # list a user's all job def list_jobs(self,user): res = [] + logger.info(self.job_queue) for job_id in self.job_queue: job = self.job_map[job_id] logger.debug('job_id: %s, user: %s' % (job_id, job.user)) diff --git a/web/templates/batch/batch_create.html b/web/templates/batch/batch_create.html index 31945f6..532a1d1 100644 --- a/web/templates/batch/batch_create.html +++ b/web/templates/batch/batch_create.html @@ -42,6 +42,7 @@