diff --git a/daliuge-engine/dlg/drop.py b/daliuge-engine/dlg/drop.py index 9e8301f0d..2b52b591d 100644 --- a/daliuge-engine/dlg/drop.py +++ b/daliuge-engine/dlg/drop.py @@ -2615,6 +2615,8 @@ def async_execute(self): t.daemon = 1 t.start() + _dlg_proc_lock = threading.Lock() + @track_current_drop def execute(self, _send_notifications=True): """ @@ -2636,8 +2638,13 @@ def execute(self, _send_notifications=True): try: if hasattr(self, "_tp"): proc = DlgProcess(target=self.run, daemon=True) - proc.start() - proc.join() + # see YAN-975 for why this is happening + lock = InputFiredAppDROP._dlg_proc_lock + with lock: + proc.start() + with lock: + proc.join() + proc.close() if proc.exception: raise proc.exception else: