Skip to content

Commit

Permalink
Merge pull request #20 from Azure/feature/by-req-id
Browse files Browse the repository at this point in the history
Deallocated bookkeeping bugfix / new certifi version
  • Loading branch information
ryanhamel authored Jan 11, 2023
2 parents cb6062e + b410ed4 commit 19699b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/hpc/autoscale/node/bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ def decrement(self, count: int = 1) -> None:
), "Requested too many nodes: %s > %s" % (count, self.available_count)
assert self.family_available_count >= 0
self.__decrement_counter += count
# self.limits.decrement(self.vcpu_count, count)

def increment(self, count: int = 1) -> None:
return self.decrement(-count)
Expand Down
8 changes: 7 additions & 1 deletion src/hpc/autoscale/node/nodemanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,9 @@ def _per_node(node: Node, constraints: List[NodeConstraint]) -> int:
satisfied = True

if satisfied:

do_decrement = node.state == "Deallocated" and not node.assignments

per_node = _per_node(node, constraints)
journal_entry = _JournalEntry(
node, constraints, per_node, assignment_id
Expand All @@ -437,9 +440,12 @@ def _per_node(node: Node, constraints: List[NodeConstraint]) -> int:
self.__journal.append(journal_entry)
allocated_nodes[node.name] = (node, node)

if do_decrement:
bucket.decrement(1)

if remaining_slots() <= 0:
break

while remaining_slots() > 0 and bucket.available_count > 0:
node_name = self._next_node_name(bucket)
new_node = node_from_bucket(
Expand Down

0 comments on commit 19699b7

Please sign in to comment.