Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not reuse the id of any vm in pool.executions #672

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/aleph/vm/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@ def is_running(self) -> bool:
else bool(self.times.starting_at and not self.times.stopping_at)
)

@property
def is_allocated(self) -> bool:
return bool(self.times.starting_at and not self.times.stopping_at)

@property
def is_stopping(self) -> bool:
return bool(self.times.stopping_at and not self.times.stopped_at)
Expand Down
4 changes: 1 addition & 3 deletions src/aleph/vm/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,7 @@ def get_unique_vm_id(self) -> int:
#
# We therefore recycle vm_id values from executions that are not running
# anymore.
currently_used_vm_ids = {
execution.vm_id for execution in self.executions.values() if execution.is_allocated
}
currently_used_vm_ids = {execution.vm_id for execution in self.executions.values()}
for i in range(settings.START_ID_INDEX, 255**2):

if self.network:
Expand Down