yamrzou commented on issue #12136:
URL: https://github.com/apache/airflow/issues/12136#issuecomment-756233260
@dmateusp I found an issue with the above fix. When running with the
followings arguments, only the first `print()` is logged, the later ones are
discarded:
```
cmds=["bash", "-c"],
arguments=[
'python -c "print(\\"hello\\")" && sleep 120 && python -c
"print(\\"hello again\\")" && sleep 30 && python -c "print(\\"last hello\\")"
&& sleep 30'
]
```
Log output:
```
[2021-01-07 16:20:55,327] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:21:55,331] {pod_launcher.py:156} INFO - b'hello\n'
[2021-01-07 16:21:55,332] {sample_dag.py:26} INFO - The pod has not logged
since the logs were last fetched
[2021-01-07 16:21:55,365] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:21:55,365] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:21:57,374] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:21:57,375] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:21:59,385] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:21:59,385] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:01,398] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:01,398] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:03,409] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:03,409] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:05,420] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:05,420] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:07,435] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:07,436] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:09,451] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:09,452] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:11,463] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:11,463] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:13,474] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:13,474] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:15,495] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:15,495] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:17,506] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:17,506] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:19,527] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:19,527] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:21,538] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:21,538] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:23,549] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:23,549] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:25,559] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:25,559] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:27,572] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:27,572] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:29,588] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:29,588] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:31,598] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:31,598] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:33,608] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:33,608] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:35,619] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:35,619] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:37,630] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:37,630] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:39,641] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:39,642] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:41,650] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:41,650] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:43,662] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:43,662] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:45,672] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:45,672] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:47,683] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:47,683] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:49,693] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:49,693] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:51,707] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:51,707] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:53,719] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:53,719] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:55,728] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:55,729] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:57,740] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:57,740] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:22:59,751] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:22:59,751] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:01,766] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:01,766] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:03,776] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:03,776] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:05,794] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:05,794] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:07,807] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:07,808] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:09,819] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:09,820] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:11,832] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:11,832] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:13,846] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:13,846] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:15,858] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:15,858] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:17,872] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:17,872] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:19,884] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:19,885] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:21,897] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:21,897] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:23,907] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:23,907] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:25,919] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:25,920] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:27,928] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:27,928] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:29,941] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:29,941] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:31,953] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:31,953] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:33,968] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:33,968] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:35,979] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:35,979] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:37,991] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:37,991] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:40,002] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:40,002] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:42,014] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:42,014] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:44,026] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:44,026] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:46,039] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:46,039] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:48,050] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:48,051] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:50,061] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:50,061] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:52,071] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:52,071] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:54,082] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Running
[2021-01-07 16:23:54,082] {pod_launcher.py:166} INFO - Pod
test-2a1b09d88b9340a291751b9c1f536d7b has state running
[2021-01-07 16:23:56,095] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Succeeded
[2021-01-07 16:23:56,095] {pod_launcher.py:287} INFO - Event with job id
test-2a1b09d88b9340a291751b9c1f536d7b Succeeded
[2021-01-07 16:23:56,106] {pod_launcher.py:173} INFO - Event:
test-2a1b09d88b9340a291751b9c1f536d7b had an event of type Succeeded
[2021-01-07 16:23:56,106] {pod_launcher.py:287} INFO - Event with job id
test-2a1b09d88b9340a291751b9c1f536d7b Succeeded
[2021-01-07 16:23:56,158] {taskinstance.py:1070} INFO - Marking task as
SUCCESS.dag_id=sample_dag_2, task_id=kubernetes_task_2,
execution_date=20210107T162031, start_date=20210107T162051,
end_date=20210107T162356
[2021-01-07 16:23:57,928] {local_task_job.py:102} INFO - Task exited with
return code 0
```
Expected log output, when using the following arguments (reduced sleep time
to avoid `IncompleteRead`):
```
'python -c "print(\\"hello\\")" && sleep 5 && python -c "print(\\"hello
again\\")" && sleep 5 && python -c "print(\\"last hello\\")" && sleep 5'
```
```
[2021-01-07 16:35:41,059] {pod_launcher.py:173} INFO - Event:
test-3a5e94a9eb344c2786e583024c9ccdfc had an event of type Pending
[2021-01-07 16:35:41,059] {pod_launcher.py:139} WARNING - Pod not yet
started: test-3a5e94a9eb344c2786e583024c9ccdfc
[2021-01-07 16:35:42,072] {pod_launcher.py:173} INFO - Event:
test-3a5e94a9eb344c2786e583024c9ccdfc had an event of type Running
[2021-01-07 16:35:57,773] {pod_launcher.py:156} INFO - b'hello\n'
[2021-01-07 16:35:57,774] {pod_launcher.py:156} INFO - b'hello again\n'
[2021-01-07 16:35:57,774] {pod_launcher.py:156} INFO - b'last hello\n'
[2021-01-07 16:35:57,790] {pod_launcher.py:173} INFO - Event:
test-3a5e94a9eb344c2786e583024c9ccdfc had an event of type Succeeded
[2021-01-07 16:35:57,791] {pod_launcher.py:287} INFO - Event with job id
test-3a5e94a9eb344c2786e583024c9ccdfc Succeeded
[2021-01-07 16:35:57,798] {pod_launcher.py:173} INFO - Event:
test-3a5e94a9eb344c2786e583024c9ccdfc had an event of type Succeeded
[2021-01-07 16:35:57,798] {pod_launcher.py:287} INFO - Event with job id
test-3a5e94a9eb344c2786e583024c9ccdfc Succeeded
[2021-01-07 16:35:57,844] {taskinstance.py:1070} INFO - Marking task as
SUCCESS.dag_id=sample_dag_2, task_id=kubernetes_task_2,
execution_date=20210107T163523, start_date=20210107T163538,
end_date=20210107T163557
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]