Skip to content

Commit 885ff75

Browse files
olethanhhoh
authored andcommitted
Do not reuse the id of any vm in pool.executions
1 parent ff6c119 commit 885ff75

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

src/aleph/vm/models.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ def is_running(self) -> bool:
9696
else bool(self.times.starting_at and not self.times.stopping_at)
9797
)
9898

99-
@property
100-
def is_allocated(self) -> bool:
101-
return bool(self.times.starting_at and not self.times.stopping_at)
102-
10399
@property
104100
def is_stopping(self) -> bool:
105101
return bool(self.times.stopping_at and not self.times.stopped_at)

src/aleph/vm/pool.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,7 @@ def get_unique_vm_id(self) -> int:
161161
#
162162
# We therefore recycle vm_id values from executions that are not running
163163
# anymore.
164-
currently_used_vm_ids = {
165-
execution.vm_id for execution in self.executions.values() if execution.is_allocated
166-
}
164+
currently_used_vm_ids = {execution.vm_id for execution in self.executions.values()}
167165
for i in range(settings.START_ID_INDEX, 255**2):
168166

169167
if self.network:

0 commit comments

Comments
 (0)