Skip to content

Commit 073eb83

Browse files
olethanhhoh
authored andcommitted
Problem: Non deterministic teardown
There was a teardown() inside a __del__ which was triggered by the garbage collection This resulted in an unclear lifecycle and strange log error since the teardown was already triggered before and made for strange error when running tests Solution: remove it
1 parent acc2302 commit 073eb83

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

src/aleph/vm/hypervisors/firecracker/microvm.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -503,13 +503,3 @@ async def teardown(self):
503503
self.config_file_path.unlink(missing_ok=True)
504504
if Path(self.namespace_path).exists():
505505
system(f"rm -fr {self.namespace_path}")
506-
507-
def __del__(self):
508-
try:
509-
loop = asyncio.get_running_loop()
510-
loop.create_task(self.teardown())
511-
except RuntimeError as error:
512-
if error.args == ("no running event loop",):
513-
return
514-
else:
515-
raise

0 commit comments

Comments
 (0)