Permalink
Browse files

Possible fix for node exclusive

  • Loading branch information...
1 parent 671a665 commit 5c6632f4584ea3589f36be84d0e7ad872a9b2b9b @oldpatricka oldpatricka committed Dec 21, 2012
Showing with 14 additions and 12 deletions.
  1. +14 −12 epu/processdispatcher/core.py
@@ -507,41 +507,43 @@ def ee_heartbeat(self, sender, beat):
new_assigned.append(key)
if len(new_assigned) != len(resource.assigned):
- log.debug("updating resource %s assignments. was %s, now %s",
- resource.resource_id, resource.assigned, new_assigned)
- resource.assigned = new_assigned
- try:
- self.store.update_resource(resource)
- except (WriteConflictError, NotFoundError):
- #TODO? right now this will just wait for the next heartbeat
- pass
-
node = self.store.get_node(resource.node_id)
if not node:
msg = "Node %s doesn't exist, but you want to set node_exclusive?" % (
resource.node_id)
log.warning(msg)
return
-
new_node_exclusive = []
for resource_id in node.resources:
resource = self.store.get_resource(resource_id)
- for owner, upid, round in resource.assigned:
+ for owner, upid, round in new_assigned:
process = self.store.get_process(owner, upid)
if process.node_exclusive:
new_node_exclusive.append(process.node_exclusive)
- log.debug("PDA: updating node %s node_exclusive. was %s, now %s" %
+ log.debug("updating node %s node_exclusive. was %s, now %s" %
(node.node_id, node.node_exclusive, new_node_exclusive))
node.node_exclusive = new_node_exclusive
+
try:
self.store.update_node(node)
except (WriteConflictError, NotFoundError):
#TODO? right now this will just wait for the next heartbeat
pass
+ log.debug("updating resource %s assignments. was %s, now %s",
+ resource.resource_id, resource.assigned, new_assigned)
+
+ resource.assigned = new_assigned
+ try:
+ self.store.update_resource(resource)
+ except (WriteConflictError, NotFoundError):
+ #TODO? right now this will just wait for the next heartbeat
+ pass
+
+
def _first_heartbeat(self, sender, beat):
node_id = beat.get('node_id')

0 comments on commit 5c6632f

Please sign in to comment.