From fc88fb948c4a9dc9464221e03556315877cee52f Mon Sep 17 00:00:00 2001
From: Mike Salvatore <mike.s.salvatore@gmail.com>
Date: Fri, 3 Dec 2021 07:18:48 -0500
Subject: [PATCH] Agent: Add a few TODOs into AutomatedMaster

---
 monkey/infection_monkey/master/automated_master.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/monkey/infection_monkey/master/automated_master.py b/monkey/infection_monkey/master/automated_master.py
index abb19b85c..3f0f31508 100644
--- a/monkey/infection_monkey/master/automated_master.py
+++ b/monkey/infection_monkey/master/automated_master.py
@@ -57,6 +57,9 @@ class AutomatedMaster(IMaster):
             logger.warning("Timed out waiting for the simulation to stop")
             # Since the master thread and all child threads are daemon threads, they will be
             # forcefully killed when the program exits.
+            # TODO: Daemon threads to not die when the parent THREAD does, but when the parent
+            #       PROCESS does. This could lead to conflicts between threads that refuse to die
+            #       and the cleanup() function. Come up with a solution.
             logger.warning("Forcefully killing the simulation")
 
     def _wait_for_master_stop_condition(self):
@@ -65,6 +68,8 @@ class AutomatedMaster(IMaster):
 
         while self._master_thread_should_run():
             if timer.is_expired():
+                # TODO: Handle exceptions in _check_for_stop() once
+                #       ControlChannel.should_agent_stop() is refactored.
                 self._check_for_stop()
                 timer.reset()