This patch prevents a race condition where the job name may not be yet be set while condor is working on the job by setting the job name in the database before submitting the job to condor.
Signed-off-by: Ian Main <[email protected]> --- src/app/util/condormatic.rb | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/util/condormatic.rb b/src/app/util/condormatic.rb index c5f71dc..cb51693 100644 --- a/src/app/util/condormatic.rb +++ b/src/app/util/condormatic.rb @@ -27,6 +27,9 @@ def condormatic_instance_create(task) job_name = "job_#{instance.name}_#{instance.id}" + instance.condor_job_id = job_name + instance.save! + # I use the 2>&1 to get stderr and stdout together because popen3 does not support # the ability to get the exit value of the command in ruby 1.8. pipe = IO.popen("condor_submit 2>&1", "w+") @@ -57,9 +60,6 @@ def condormatic_instance_create(task) Rails.logger.info "$? (return value?) is #{$?}" raise ("Error calling condor_submit: #{out}") if $? != 0 - instance.condor_job_id = job_name - instance.save! - rescue Exception => ex task.state = Task::STATE_FAILED Rails.logger.error ex.message -- 1.7.1.1 _______________________________________________ deltacloud-devel mailing list [email protected] https://fedorahosted.org/mailman/listinfo/deltacloud-devel
