apache / apache/beam

Portable runner does not return job exit status to client after long-running job

Open
#21,597 0 comments 0 reactions 0 assignees View on GitHub
bug core flink P2 python runners
Dominant language
Java
Stars
8.7k
Forks
4.7k
Avg merge
1d 20h
Merged PRs (30d)
196

Description

I submit Python Beam jobs to our Flink cluster with the PortableRunner through a remote job server. If a job finishes within a few seconds or minutes, the return status (including a dump of any Python exceptions in case there was an error) is returned to the client upon completion.

If the job, however, runs for longer (say) hours, then the client and job server seem to lose connection. This results in the client hanging forever until I press Ctrl****C to terminate it, even long after the actual job has completed (which has no effect whatsoever on the actual job).

Example pseudo job:
```

print('Job started')
with beam.Pipeline() as pipeline:
    pipeline | DoSomething()
print('Job finished')
```

If the pipeline finishes quickly, it looks like this from the client's perspective:
```

$ python3 myjob.py
Job started
Job finished
$ _
```

If the job runs for longer, then the `with` statement never finishes and I have to abort the Python script with Ctrl****C:
```

$ python3 myjob.py
Job started
^C
$ _
```

Imported from Jira [BEAM-14080](https://issues.apache.org/jira/browse/BEAM-14080). Original Jira may contain additional context.
Reported by: phoerious.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.