Abacn commented on code in PR #40298:
URL: https://github.com/apache/beam/pull/40298#discussion_r4125014773
##########
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:
IIUC Java's prism runner wrapper downloads a prism binary if not already
exist in `.cache/apache_beam`. If downloads fail (no access to github.com;
platform not have pre-build binary; run on a dev version and the binary not
built separately; blocked by Stanta; etc) it could fail
--
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]