acoustic-carpenter-78188
10/28/2023, 12:21 AMShellTask might hit the deadlock described in https://docs.python.org/3/library/subprocess.html#subprocess.Popen.wait if the child process ends up writing more than the pipe buffer size (which in most Linux systems sits around 65KB, or 16 pages).
The fix is to use Popen.communicate, which waits for the process to terminate and returns a tuple (stdout_data, stderr_data). The one downside of this is that it keeps both stdout and stderr in memory. We might expose a flag to use the slower method of using temporary files to hold the child process's stdout and stderr in the future.
The test I added demonstrates the deadlock with the old code.
Tracking Issue
flyteorg/flyte#4313
Follow-up issue
NA
OR
https://github.com/flyteorg/flyte/issues/
flyteorg/flytekit
Codecov: 54.71% (-0.01%) compared to 4d5e1b8
Codecov: 0.00% of diff hit (target 54.71%)
✅ 28 other checks have passed
28/30 successful checksacoustic-carpenter-78188
10/30/2023, 5:02 PM