Permalink
Browse files

Added a "head_room" parameter to make doubly sure we're not adding mo…

…re nodes to

the cluster than max_nodes has specified, taking into account any nodes that may
have failed to come up completely.
  • Loading branch information...
1 parent 8e38479 commit a8f3514162f701670c6451acbc4dc7a7019ccfc2 @rqbanerjee committed May 31, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 starcluster/balancers/sge/__init__.py
@@ -456,8 +456,10 @@ def _mkdir(self, directory, makedirs=False):
try:
if makedirs:
os.makedirs(directory)
+ logger.info("Created directories %s." % directory)
else:
os.mkdir(directory)
+ logger.info("Created single directory %s." % directory)
except IOError, e:
raise exception.BaseException(str(e))
@@ -635,7 +637,8 @@ def _eval_add_node(self):
" shorter than 10 minutes in duration.")
#need_to_add = 0
if need_to_add > 0:
- need_to_add = min(self.add_nodes_per_iteration, need_to_add)
+ head_room = self.max_nodes - len(self.stat.hosts)
+ need_to_add = min(self.add_nodes_per_iteration, need_to_add, head_room)
log.info("*** ADDING %d NODES at %s." %
(need_to_add, str(datetime.datetime.utcnow())))
try:

0 comments on commit a8f3514

Please sign in to comment.