4410: crunch-dispatch logs crunch-job exit later.
[arvados.git] / services / api / script / crunch-dispatch.rb
index 1002f9134736ab84136f2f8b9032ff630e14ce84..3c1e4c60cd4bba2185f91c9025d61fddeb31dbf0 100755 (executable)
@@ -634,8 +634,6 @@ class Dispatcher
     return if !pid_done
 
     job_done = j_done[:job]
-    $stderr.puts "dispatch: child #{pid_done} exit"
-    $stderr.puts "dispatch: job #{job_done.uuid} end"
 
     # Ensure every last drop of stdout and stderr is consumed.
     read_pipes
@@ -653,6 +651,9 @@ class Dispatcher
     # Wait the thread (returns a Process::Status)
     exit_status = j_done[:wait_thr].value.exitstatus
 
+    $stderr.puts "dispatch: child #{pid_done} exit #{exit_status}"
+    $stderr.puts "dispatch: job #{job_done.uuid} end"
+
     jobrecord = Job.find_by_uuid(job_done.uuid)
     if exit_status != EXIT_TEMPFAIL and jobrecord.state == "Running"
       # crunch-job did not return exit code 75 (see below) and left the job in