DataflowPipelineJob.waitUntilFinish() crashes when it has created a template.
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 4.7k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 196
Description
```
INFO: Template successfully created.
Exception in thread "main" java.lang.UnsupportedOperationException:
The result of template creation should not be used.
at org.apache.beam.runners.dataflow.util.DataflowTemplateJob.getJobId(DataflowTemplateJob.java:37)
at org.apache.beam.runners.dataflow.DataflowPipelineJob.getJobWithRetries(DataflowPipelineJob.java:524)
at org.apache.beam.runners.dataflow.DataflowPipelineJob.getStateWithRetries(DataflowPipelineJob.java:506)
at org.apache.beam.runners.dataflow.DataflowPipelineJob.waitUntilFinish(DataflowPipelineJob.java:295)
at org.apache.beam.runners.dataflow.DataflowPipelineJob.waitUntilFinish(DataflowPipelineJob.java:224)
at org.apache.beam.runners.dataflow.DataflowPipelineJob.waitUntilFinish(DataflowPipelineJob.java:183)
at org.apache.beam.runners.dataflow.DataflowPipelineJob.waitUntilFinish(DataflowPipelineJob.java:176)
```
This is a real error. If a template was created, the job is complete. Instead of crashing by tried to access the job id, as though `DataflowPipelineJob` doesn't know it made a template, it should instead return successfully. Or perhaps there is another design choice. But just crashes does not make sense. Probably `DataflowRunner` should not return a `DataflowPipelineJob` at all in this way.
Imported from Jira [BEAM-9337](https://issues.apache.org/jira/browse/BEAM-9337). Original Jira may contain additional context.
Reported by: kenn.
Contributor guide
Assessment
This issue has not been assessed yet.