Skip to content

Commit

Permalink
More cleanup debug
Browse files Browse the repository at this point in the history
  • Loading branch information
angusjfw committed Nov 3, 2022
1 parent 7f6a622 commit b775020
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions further_link/runner/process_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ async def _handle_output(self, stream, channel):
async def _clean_up(self):
logging.debug(f"{self.id} Starting cleanup")
if getattr(self, "pty", None):
logging.debug(f"{self.id} Cleaning up PTY")
try:
if getattr(self, "pty_master", None):
await self.pty_master.close()
Expand All @@ -302,12 +303,14 @@ async def _clean_up(self):
logging.exception(f"{self.id} PTY Cleanup error: {e}")

if getattr(self, "novnc", None):
logging.debug(f"{self.id} Cleaning up NOVNC")
try:
await async_stop(self.id)
except Exception as e:
logging.exception(f"{self.id} NOVNC Cleanup error: {e}")

if getattr(self, "ipc_tasks", None):
logging.debug(f"{self.id} Cleaning up IPC")
try:
for channel in SERVER_IPC_CHANNELS:
ipc_cleanup(channel, pgid=self.pgid)
Expand All @@ -317,5 +320,6 @@ async def _clean_up(self):
except Exception as e:
logging.exception(f"{self.id} IPC Cleanup error: {e}")

logging.debug(f"{self.id} Releasing ID")
id_generator.free(self.id)
logging.debug(f"{self.id} Cleanup complete")

0 comments on commit b775020

Please sign in to comment.