From d5f6797eadc02012e699d8850d6967d922f92b1f Mon Sep 17 00:00:00 2001 From: "Krzysztof A. Adamski" Date: Wed, 6 Aug 2008 19:19:53 -0400 Subject: Fix async job IDs problem, finally. --- func/jobthing.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/func/jobthing.py b/func/jobthing.py index cc6808b..d5fc2a8 100644 --- a/func/jobthing.py +++ b/func/jobthing.py @@ -170,8 +170,9 @@ def batch_run(pool, callback, nforks,**extra_args): # kick off the job results = forkbomb.batch_run(pool, callback, nforks) - # we now have a list of job id's for each minion, kill the task + # write job IDs to the state file on overlord __update_status(job_id, JOB_ID_PARTIAL, results) + # we now have a list of job id's for each minion, kill the task os._exit(0) def minion_async_run(retriever, method, args): @@ -247,11 +248,11 @@ def job_status(jobid, client_class=None): some_missing = True if some_missing or not interim_results: - if partial_results: - __update_status(jobid, JOB_ID_PARTIAL, partial_results) return (JOB_ID_PARTIAL, partial_results) else: + # Save partial results in state file so next time we don't + # call minions to get status. if partial_results: __update_status(jobid,JOB_ID_FINISHED, partial_results) return (JOB_ID_FINISHED, partial_results) -- cgit