Skip to content

Commit

Permalink
misc: explicit exit (#6)
Browse files Browse the repository at this point in the history
Ensure the termination of main thread by explicitly calling os._exit(0).
  • Loading branch information
myungjin authored May 25, 2024
1 parent d346215 commit 62cee52
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions multiworld/world_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,13 @@ def __init__(self, enable_monitor=True):
_ = asyncio.create_task(self._cleanup_worlds())

def cleanup(self):
"""Call exit(0) explicitly."""
"""Call os._exit(0) explicitly."""
# TODO: This is a temporary workaround to prevent main thread hang
# even after it's done. Calling exit(0) guarantees termination
# of the process. We need to figure out why sometimes it's not
# terminated without explicit call of exit().
exit(0)
# even after it's done. Calling os._exit(0) guarantees
# terminationof the process. We need to figure out why
# sometimes it's not terminated without explicit call of
# os._exit(0).
os._exit(0)

async def _cleanup_worlds(self):
logger.debug("starting _cleanup_worlds task")
Expand Down

0 comments on commit 62cee52

Please sign in to comment.