diff --git a/src/_ert/forward_model_runner/job_dispatch.py b/src/_ert/forward_model_runner/job_dispatch.py index 7af3b6e4bc0..ccd1e5044c2 100644 --- a/src/_ert/forward_model_runner/job_dispatch.py +++ b/src/_ert/forward_model_runner/job_dispatch.py @@ -13,7 +13,12 @@ def sigterm_handler(_signo, _stack_frame): def main(): os.nice(19) signal.signal(signal.SIGTERM, sigterm_handler) - job_runner_main(sys.argv) + try: + job_runner_main(sys.argv) + except Exception as e: + pgid = os.getpgid(os.getpid()) + os.killpg(pgid, signal.SIGTERM) + raise e if __name__ == "__main__":