From 7516505623c8d863ed368fd63945877824aaa45e Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 3 Dec 2021 08:06:46 -0500 Subject: [PATCH] Agent: Join on pba_thread to ensure it completes before simulation ends --- monkey/infection_monkey/master/automated_master.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/monkey/infection_monkey/master/automated_master.py b/monkey/infection_monkey/master/automated_master.py index 3f0f31508..1868aee1f 100644 --- a/monkey/infection_monkey/master/automated_master.py +++ b/monkey/infection_monkey/master/automated_master.py @@ -99,7 +99,9 @@ class AutomatedMaster(IMaster): pba_thread.start() # Future stages of the simulation require the output of the system info collectors. Nothing - # requires the output of PBAs, so we don't need to join on that thread. + # requires the output of PBAs, so we don't need to join on that thread here. We will join on + # the PBA thread later in this function to prevent the simulation from ending while PBAs are + # still running. system_info_collector_thread.join() if self._can_propagate(): @@ -115,6 +117,8 @@ class AutomatedMaster(IMaster): payload_thread.start() payload_thread.join() + pba_thread.join() + # TODO: This code is just for testing in development. Remove when # implementation of AutomatedMaster is finished. while True: