danmactough commented on issue #4039: [AIRFLOW-3046] Fix ECS Operator 
mistakenly reports success
URL: 
https://github.com/apache/incubator-airflow/pull/4039#issuecomment-429198267
 
 
   > If this response is not successful, then mark the task as failed. What do 
you think @danmactough ?
   
   I _think_ this is the only possible way, @Fokko, with the responses we get 
from AWS. The response we get doesn't have any failures, doesn't have a 
non-zero exitCode (it has no exitCode), and there's no explicit error. Here's a 
sample response:
   
   ```
   [2018-09-12 01:02:02,712] {ecs_operator.py:112} INFO - ECS Task stopped, 
check status: {
     'tasks': [
       {
         'taskArn': 
'arn:aws:ecs:us-east-1:111111111111:task/32d43a1d-fbc7-4659-815d-9133bde11cdc', 
         'clusterArn': 'arn:aws:ecs:us-east-1:111111111111:cluster/processing', 
         'taskDefinitionArn': 
'arn:aws:ecs:us-east-1:111111111111:task-definition/foobar-testing_dataEngineering_rd:76',
 
         'containerInstanceArn': 
'arn:aws:ecs:us-east-1:111111111111:container-instance/7431f0a6-8fc5-4eff-8196-32f77d286a61',
 
         'overrides': {
           'containerOverrides': [
             {
               'name': 'foobar-testing', 
               'command': [
                 './bin/generate-features.sh', 
                 '2018-09-11'
               ]
             }
           ]
         }, 
         'lastStatus': 'STOPPED', 
         'desiredStatus': 'STOPPED', 
         'cpu': '4096', 
         'memory': '60000', 
         'containers': [
           {
             'containerArn': 
'arn:aws:ecs:us-east-1:111111111111:container/0d5cc553-f894-4f9a-b17c-9f80f7ce8d0a',
 
             'taskArn': 
'arn:aws:ecs:us-east-1:111111111111:task/32d43a1d-fbc7-4659-815d-9133bde11cdc', 
             'name': 'foobar-testing', 
             'lastStatus': 'RUNNING', 
             'networkBindings': [], 
             'networkInterfaces': [], 
             'healthStatus': 'UNKNOWN'
           }
         ], 
         'startedBy': 'Airflow', 
         'version': 3, 
         'stoppedReason': 'Host EC2 (instance i-02cf23bbd5ae26194) 
terminated.', 
         'connectivity': 'CONNECTED', 
         'connectivityAt': datetime.datetime(2018, 9, 12, 0, 6, 30, 245000, 
tzinfo=tzlocal()), 
         'pullStartedAt': datetime.datetime(2018, 9, 12, 0, 6, 32, 748000, 
tzinfo=tzlocal()), 
         'pullStoppedAt': datetime.datetime(2018, 9, 12, 0, 6, 59, 748000, 
tzinfo=tzlocal()), 
         'createdAt': datetime.datetime(2018, 9, 12, 0, 6, 30, 245000, 
tzinfo=tzlocal()), 
         'startedAt': datetime.datetime(2018, 9, 12, 0, 7, 0, 748000, 
tzinfo=tzlocal()), 
         'stoppingAt': datetime.datetime(2018, 9, 12, 1, 2, 0, 91000, 
tzinfo=tzlocal()), 
         'stoppedAt': datetime.datetime(2018, 9, 12, 1, 2, 0, 91000, 
tzinfo=tzlocal()), 
         'group': 'family:foobar-testing_dataEngineering_rd', 
         'launchType': 'EC2', 
         'attachments': [], 
         'healthStatus': 'UNKNOWN'
       }
     ], 
     'failures': [], 
     'ResponseMetadata': {
       'RequestId': '758c791f-b627-11e8-83f7-2b76f4796ed2', 
       'HTTPStatusCode': 200, 
       'HTTPHeaders': {
         'server': 'Server', 
         'date': 'Wed, 12 Sep 2018 01:02:02 GMT', 
         'content-type': 'application/x-amz-json-1.1', 
         'content-length': '1412', 
         'connection': 'keep-alive', 
         'x-amzn-requestid': '758c791f-b627-11e8-83f7-2b76f4796ed2'
       }, 
     'RetryAttempts': 0
     }
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to