From 7b8ebf524ca7567c938e2df653e2868b0fa6148a Mon Sep 17 00:00:00 2001 From: Josh Karpel Date: Thu, 24 Oct 2024 19:24:56 -0500 Subject: [PATCH 1/2] allow process to already not exist when trying to kill it --- synthesize/execution.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/synthesize/execution.py b/synthesize/execution.py index 3d34768..e990585 100644 --- a/synthesize/execution.py +++ b/synthesize/execution.py @@ -110,7 +110,11 @@ def _send_signal(self, signal: int) -> None: if self.has_exited: return None - os.killpg(os.getpgid(self.process.pid), signal) + try: + os.killpg(os.getpgid(self.process.pid), signal) + except ProcessLookupError: + # process exited before we could send the signal + pass def terminate(self) -> None: self._send_signal(SIGTERM) From 813ab334d02e73865782a60cd032c2b7fd222eb2 Mon Sep 17 00:00:00 2001 From: Josh Karpel Date: Thu, 24 Oct 2024 19:28:05 -0500 Subject: [PATCH 2/2] changelog entry --- docs/changelog.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/changelog.md b/docs/changelog.md index 55d0d42..625ee7a 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,14 @@ # Changelog +## `0.0.4` + +Released `2024-10-24` + +### Fixed + +- [#79](https://github.com/JoshKarpel/synthesize/pull/79) + Fix a crash that could happen when a process exits while we are trying to terminate it. + ## `0.0.3` Released `2024-07-07`