4334: Convert "idle*" state to "down"
authorPeter Amstutz <peter.amstutz@curoverse.com>
Thu, 6 Nov 2014 19:22:40 +0000 (14:22 -0500)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Thu, 6 Nov 2014 19:22:40 +0000 (14:22 -0500)
services/api/script/crunch-dispatch.rb

index b3ab9bf06ce61a1df23da4e381182dcbcf62f768..81e1ef96e3157b22e0ded88795ae7c6d380f8662 100755 (executable)
@@ -93,6 +93,9 @@ class Dispatcher
   def slurm_status
     slurm_nodes = {}
     each_slurm_line("sinfo", "%t") do |hostname, state|
+      # Treat nodes in idle* state as down, because the * means that slurm
+      # hasn't been able to communicate with it recently.
+      state.sub!(/^idle\*/, "down")
       state.sub!(/\W+$/, "")
       state = "down" unless %w(idle alloc down).include?(state)
       slurm_nodes[hostname] = {state: state, job: nil}