[ARVADOS] created: 9d6fb27b6a0ef28062be37efdea20d1a4c7079d3

Git user git at public.curoverse.com
Fri May 26 16:00:26 EDT 2017


        at  9d6fb27b6a0ef28062be37efdea20d1a4c7079d3 (commit)


commit 9d6fb27b6a0ef28062be37efdea20d1a4c7079d3
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Fri May 26 15:49:32 2017 -0400

    11769: HasUuid::UUID_REGEX matches anything that looks like an Arvados uuid. As a result, if crunchv1 and crunchv2 dispatchers are on the same cluster, crunch-dispatch.rb will try to scancel containers thinking they are "orphan jobs".  Tighten the regex to only match job uuids.

diff --git a/services/api/lib/crunch_dispatch.rb b/services/api/lib/crunch_dispatch.rb
index 2ae99f0..3ef1803 100644
--- a/services/api/lib/crunch_dispatch.rb
+++ b/services/api/lib/crunch_dispatch.rb
@@ -892,7 +892,7 @@ class CrunchDispatch
 
   def check_orphaned_slurm_jobs
     act_as_system_user do
-      squeue_uuids = squeue_jobs.select{|uuid| uuid.match(HasUuid::UUID_REGEX)}.
+      squeue_uuids = squeue_jobs.select{|uuid| uuid.match(/^[0-9a-z]{5}-8i9sb-[0-9a-z]{15}$/)}.
                                   select{|uuid| !@running.has_key?(uuid)}
 
       return if squeue_uuids.size == 0
diff --git a/services/api/test/unit/crunch_dispatch_test.rb b/services/api/test/unit/crunch_dispatch_test.rb
index d091847..6107205 100644
--- a/services/api/test/unit/crunch_dispatch_test.rb
+++ b/services/api/test/unit/crunch_dispatch_test.rb
@@ -208,7 +208,7 @@ class CrunchDispatchTest < ActiveSupport::TestCase
     act_as_system_user do
       dispatch = CrunchDispatch.new
 
-      squeue_resp = IO.popen("echo zzzzz-8i9sb-pshmckwoma9plh7\necho thisisnotvalidjobuuid\necho zzzzz-8i9sb-4cf0abc123e809j\n")
+      squeue_resp = IO.popen("echo zzzzz-8i9sb-pshmckwoma9plh7\necho thisisnotvalidjobuuid\necho zzzzz-8i9sb-4cf0abc123e809j\necho zzzzz-dz642-o04e3r651turtdr\n")
       scancel_resp = IO.popen("true")
 
       IO.expects(:popen).

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list