You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by pa...@apache.org on 2023/06/09 18:02:02 UTC

[beam] branch master updated: Preserve output when a pipeline dies on timeout (#26928) (#26929)

This is an automated email from the ASF dual-hosted git repository.

pabloem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new e772c0bcd2e Preserve output when a pipeline dies on timeout (#26928) (#26929)
e772c0bcd2e is described below

commit e772c0bcd2e39b871d93ffdc6f9a919f7dbf653e
Author: alexeyinkin <le...@inkin.ru>
AuthorDate: Fri Jun 9 22:01:51 2023 +0400

    Preserve output when a pipeline dies on timeout (#26928) (#26929)
---
 .../lib/src/controllers/code_runner.dart           | 28 +++++++++++++---------
 1 file changed, 17 insertions(+), 11 deletions(-)

diff --git a/playground/frontend/playground_components/lib/src/controllers/code_runner.dart b/playground/frontend/playground_components/lib/src/controllers/code_runner.dart
index 68b357b3632..3728d4a879e 100644
--- a/playground/frontend/playground_components/lib/src/controllers/code_runner.dart
+++ b/playground/frontend/playground_components/lib/src/controllers/code_runner.dart
@@ -16,6 +16,8 @@
  * limitations under the License.
  */
 
+// ignore_for_file: prefer_interpolation_to_compose_strings
+
 import 'dart:async';
 
 import 'package:clock/clock.dart';
@@ -155,7 +157,6 @@ class CodeRunner extends ChangeNotifier {
 
     final log = parsedPipelineOptions.isEmpty
         ? kProcessingStartedText
-        // ignore: prefer_interpolation_to_compose_strings
         : kProcessingStartedOptionsText +
             parsedPipelineOptions.entries
                 .map((e) => '--${e.key} ${e.value}')
@@ -209,7 +210,10 @@ class CodeRunner extends ChangeNotifier {
       _setResult(
         RunCodeResult(
           errorMessage: ex.message ?? kUnknownErrorText,
-          output: ex.message ?? kUnknownErrorText,
+          log: _result!.log,
+          output: (_result!.output ?? '') +
+              '\n' +
+              (ex.message ?? kUnknownErrorText),
           sdk: request.sdk,
           status: RunCodeStatus.unknownError,
         ),
@@ -219,7 +223,8 @@ class CodeRunner extends ChangeNotifier {
       _setResult(
         RunCodeResult(
           errorMessage: kUnknownErrorText,
-          output: kUnknownErrorText,
+          log: _result!.log,
+          output: (_result!.output ?? '') + '\n' + kUnknownErrorText,
           sdk: request.sdk,
           status: RunCodeStatus.unknownError,
         ),
@@ -270,6 +275,8 @@ class CodeRunner extends ChangeNotifier {
 
     _setResult(
       RunCodeResult(
+        graph: _result!.graph,
+        log: _result!.log,
         output: _result!.output,
         sdk: _result!.sdk,
         status: _result!.status,
@@ -311,7 +318,6 @@ class CodeRunner extends ChangeNotifier {
     _setResult(
       RunCodeResult(
         graph: _result?.graph,
-        // ignore: prefer_interpolation_to_compose_strings
         log: (_result?.log ?? '') +
             '\n' +
             'widgets.output.messages.pipelineCancelled'.tr(),
@@ -344,7 +350,6 @@ class CodeRunner extends ChangeNotifier {
     _setResult(
       RunCodeResult(
         graph: selectedExample.graph,
-        // ignore: prefer_interpolation_to_compose_strings
         log: kCachedResultsLog + logs,
         output: selectedExample.outputs,
         sdk: selectedExample.sdk,
@@ -399,7 +404,7 @@ class CodeRunner extends ChangeNotifier {
         return RunCodeResult(
           graph: prevGraph,
           log: prevLog,
-          output: compileOutput.output,
+          output: prevOutput + compileOutput.output,
           pipelineUuid: pipelineUuid,
           sdk: prevResult.sdk,
           status: status,
@@ -410,7 +415,7 @@ class CodeRunner extends ChangeNotifier {
           errorMessage: kTimeoutErrorText,
           graph: prevGraph,
           log: prevLog,
-          output: kTimeoutErrorText,
+          output: prevOutput + kTimeoutErrorText,
           pipelineUuid: pipelineUuid,
           sdk: prevResult.sdk,
           status: status,
@@ -421,7 +426,7 @@ class CodeRunner extends ChangeNotifier {
         return RunCodeResult(
           graph: prevGraph,
           log: prevLog,
-          output: output.output,
+          output: prevOutput + output.output,
           pipelineUuid: pipelineUuid,
           sdk: prevResult.sdk,
           status: status,
@@ -432,7 +437,7 @@ class CodeRunner extends ChangeNotifier {
         return RunCodeResult(
           graph: prevGraph,
           log: prevLog,
-          output: output.output,
+          output: prevOutput + output.output,
           sdk: prevResult.sdk,
           status: status,
         );
@@ -443,7 +448,7 @@ class CodeRunner extends ChangeNotifier {
         return RunCodeResult(
           graph: prevGraph,
           log: prevLog,
-          output: output.output,
+          output: prevOutput + output.output,
           sdk: prevResult.sdk,
           status: status,
         );
@@ -453,7 +458,7 @@ class CodeRunner extends ChangeNotifier {
           errorMessage: kUnknownErrorText,
           graph: prevGraph,
           log: prevLog,
-          output: kUnknownErrorText,
+          output: prevOutput + kUnknownErrorText,
           pipelineUuid: pipelineUuid,
           sdk: prevResult.sdk,
           status: status,
@@ -508,6 +513,7 @@ class CodeRunner extends ChangeNotifier {
         return RunCodeResult(
           graph: prevGraph,
           log: prevLog,
+          output: prevOutput,
           pipelineUuid: pipelineUuid,
           sdk: prevResult.sdk,
           status: status,