[ARVADOS] updated: e7091ec45f8f634a52db2fba1b385e790d69e6fe
Git user
git at public.curoverse.com
Fri Apr 15 11:13:23 EDT 2016
Summary of changes:
.../arvnodeman/computenode/dispatch/__init__.py | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
via e7091ec45f8f634a52db2fba1b385e790d69e6fe (commit)
from 3dc4c3e304a1d2ccb975a43679276eed55bd49fd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit e7091ec45f8f634a52db2fba1b385e790d69e6fe
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Fri Apr 15 11:13:12 2016 -0400
8953: Clarify how to use return value from consulting transitions table and shutdown_eligible().
diff --git a/services/nodemanager/arvnodeman/computenode/dispatch/__init__.py b/services/nodemanager/arvnodeman/computenode/dispatch/__init__.py
index dbecfd3..412e6f8 100644
--- a/services/nodemanager/arvnodeman/computenode/dispatch/__init__.py
+++ b/services/nodemanager/arvnodeman/computenode/dispatch/__init__.py
@@ -356,9 +356,16 @@ class ComputeNodeMonitorActor(config.actor_class):
return result
def shutdown_eligible(self):
- # Collect states and then consult state transition table
- # whether we should shut down. Possible states are:
- #
+ """Determine if node is candidate for shut down.
+
+ Returns True if the node is candidate for shut down, if not, returns a
+ string explaining why it is not a candidate for shut down. It is very
+ import to test the return value of this method as
+ "if shutdown_eligible() is True:".
+ """
+
+ # Collect states and then consult state transition table whether we
+ # should shut down. Possible states are:
# crunch_worker_state = ['unpaired', 'busy', 'idle', 'down']
# window = ["open", "closed"]
# boot_grace = ["boot wait", "boot exceeded"]
@@ -386,9 +393,11 @@ class ComputeNodeMonitorActor(config.actor_class):
node_state = (crunch_worker_state, window, boot_grace, idle_grace)
t = transitions[node_state]
self._debug("Node state is %s, transition is %s", node_state , t)
- if t:
+ if t is not None:
+ # yes, shutdown eligible
return True
else:
+ # no, return a reason
return "node state is %s" % (node_state,)
def consider_shutdown(self):
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list