From 0dc7524417ad37fd99af583ea38e972e705fea90 Mon Sep 17 00:00:00 2001 From: Josh Smith Date: Thu, 30 Aug 2018 11:57:23 +0100 Subject: job.py: Modify retry messages to be FAIL This adjusts the message handler for the child processes to no longer override the message type. This also removes the ability for unhandled non BstError exceptions to retry. --- buildstream/_scheduler/jobs/job.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/buildstream/_scheduler/jobs/job.py b/buildstream/_scheduler/jobs/job.py index 922ce5613..165c7c83f 100644 --- a/buildstream/_scheduler/jobs/job.py +++ b/buildstream/_scheduler/jobs/job.py @@ -403,7 +403,7 @@ class Job(): if self._retry_flag and (self._tries <= self._max_retries): self.message(MessageType.FAIL, "Try #{} failed, retrying".format(self._tries), - elapsed=elapsed) + elapsed=elapsed, logfile=filename) else: self.message(MessageType.FAIL, str(e), elapsed=elapsed, detail=e.detail, @@ -430,7 +430,8 @@ class Job(): self.message(MessageType.BUG, self.action_name, elapsed=elapsed, detail=detail, logfile=filename) - self._child_shutdown(RC_FAIL) + # Unhandled exceptions should permenantly fail + self._child_shutdown(RC_PERM_FAIL) else: # No exception occurred in the action @@ -509,11 +510,6 @@ class Job(): message.action_name = self.action_name message.task_id = self._task_id - if (message.message_type == MessageType.FAIL and - self._tries <= self._max_retries and self._retry_flag): - # Job will be retried, display failures as warnings in the frontend - message.message_type = MessageType.WARN - # Send to frontend if appropriate if context.silent_messages() and (message.message_type not in unconditional_messages): return -- cgit v1.2.1 From d013bb2c07ff8b742bfa67407b544ef061e9bf6f Mon Sep 17 00:00:00 2001 From: Josh Smith Date: Thu, 30 Aug 2018 14:47:01 +0100 Subject: tests: Modify tests to ensure retry FAILURE --- tests/sources/deb.py | 2 +- tests/sources/tar.py | 2 +- tests/sources/zip.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/sources/deb.py b/tests/sources/deb.py index 9df0dadf0..b5b031161 100644 --- a/tests/sources/deb.py +++ b/tests/sources/deb.py @@ -56,7 +56,7 @@ def test_fetch_bad_url(cli, tmpdir, datafiles): result = cli.run(project=project, args=[ 'fetch', 'target.bst' ]) - assert "Try #" in result.stderr + assert "FAILURE Try #" in result.stderr result.assert_main_error(ErrorDomain.STREAM, None) result.assert_task_error(ErrorDomain.SOURCE, None) diff --git a/tests/sources/tar.py b/tests/sources/tar.py index fb02de306..39afd7881 100644 --- a/tests/sources/tar.py +++ b/tests/sources/tar.py @@ -66,7 +66,7 @@ def test_fetch_bad_url(cli, tmpdir, datafiles): result = cli.run(project=project, args=[ 'fetch', 'target.bst' ]) - assert "Try #" in result.stderr + assert "FAILURE Try #" in result.stderr result.assert_main_error(ErrorDomain.STREAM, None) result.assert_task_error(ErrorDomain.SOURCE, None) diff --git a/tests/sources/zip.py b/tests/sources/zip.py index a168d529b..73767ee79 100644 --- a/tests/sources/zip.py +++ b/tests/sources/zip.py @@ -53,7 +53,7 @@ def test_fetch_bad_url(cli, tmpdir, datafiles): result = cli.run(project=project, args=[ 'fetch', 'target.bst' ]) - assert "Try #" in result.stderr + assert "FAILURE Try #" in result.stderr result.assert_main_error(ErrorDomain.STREAM, None) result.assert_task_error(ErrorDomain.SOURCE, None) -- cgit v1.2.1