You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by ak...@apache.org on 2023/08/24 14:10:38 UTC
[buildstream] branch abderrahim/fix-hang created (now d54dddd73)
This is an automated email from the ASF dual-hosted git repository.
akitouni pushed a change to branch abderrahim/fix-hang
in repository https://gitbox.apache.org/repos/asf/buildstream.git
at d54dddd73 job.py: catch exceptions raised by "child" jobs
This branch includes the following new commits:
new d54dddd73 job.py: catch exceptions raised by "child" jobs
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[buildstream] 01/01: job.py: catch exceptions raised by "child" jobs
Posted by ak...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
akitouni pushed a commit to branch abderrahim/fix-hang
in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit d54dddd733ca12d064148b966e1882e760010e64
Author: Abderrahim Kitouni <ab...@codethink.co.uk>
AuthorDate: Thu Aug 24 15:10:12 2023 +0100
job.py: catch exceptions raised by "child" jobs
This prevents buildstream from hanging when such exceptions are raised
---
src/buildstream/_scheduler/jobs/job.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/buildstream/_scheduler/jobs/job.py b/src/buildstream/_scheduler/jobs/job.py
index 6a9101f34..a0e933cce 100644
--- a/src/buildstream/_scheduler/jobs/job.py
+++ b/src/buildstream/_scheduler/jobs/job.py
@@ -153,8 +153,12 @@ class Job:
loop = asyncio.get_event_loop()
async def execute():
- ret_code, self._result = await loop.run_in_executor(None, self._child.child_action)
- await self._parent_child_completed(ret_code)
+ try:
+ ret_code, self._result = await loop.run_in_executor(None, self._child.child_action)
+ await self._parent_child_completed(ret_code)
+ except Exception as e:
+ self.message(MessageType.ERROR, f"Unexpected error: {e}")
+ await self._parent_child_completed(_ReturnCode.TERMINATED)
self._task = loop.create_task(execute())