reuvenlax commented on code in PR #40298:
URL: https://github.com/apache/beam/pull/40298#discussion_r4124497027


##########
runners/prism/java/src/main/java/org/apache/beam/runners/prism/PrismRunner.java:
##########
@@ -82,19 +83,37 @@ public PipelineResult run(Pipeline pipeline) {
         prismPipelineOptions.getDefaultEnvironmentType(),
         prismPipelineOptions.getJobEndpoint());
 
-    try {
-      PrismExecutor executor = startPrism();
-      PortableRunner delegate = 
PortableRunner.fromOptions(prismPipelineOptions);
-      return new PrismPipelineResult(delegate.run(pipeline), executor::stop);
-    } catch (IOException e) {
-      throw new RuntimeException(e);
+    for (int attempt = 1; ; attempt++) {
+      PrismExecutor executor;
+      try {
+        executor = startPrism();
+      } catch (IOException e) {
+        throw new RuntimeException(e);
+      }
+      try {
+        PortableRunner delegate = 
PortableRunner.fromOptions(prismPipelineOptions);
+        return new PrismPipelineResult(delegate.run(pipeline), executor::stop);
+      } catch (RuntimeException e) {
+        boolean alive = executor.isAlive();
+        executor.stop();
+        if (attempt < MAX_START_ATTEMPTS
+            && (!alive
+                || (e.getMessage() != null && 
e.getMessage().contains("JobService/Prepare")))) {

Review Comment:
   Do we expect genuine failures on starting the Prism runner? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to