madcolonel10 opened a new issue #12089:
URL: https://github.com/apache/airflow/issues/12089


   **Airflow version: 1.10.12**
   ```python
   import random
   import string
   
   import requests
   from airflow import DAG
   from airflow.contrib.sensors.python_sensor import PythonSensor
   from airflow.operators.dummy_operator import DummyOperator
   from datetime import datetime
   
   dag = DAG(
       dag_id='newDebugDag',
       description='A simple tutorial DAG',
       schedule_interval=None,
       start_date=datetime(2020, 10, 30, 0, 0)
   )
   
   start = DummyOperator(task_id='run_this_first', dag=dag)
   
   
   def wait_for_approval(dag_run, **context):
       software_id = dag_run.conf.get("softwareId", "Some Software Id")
       print("polling status for softwareId:{}".format(software_id))
       response = 
requests.get('https://5f8582eec29abd0016190be2.mockapi.io/api/v1/status')
       print(response.json())
       context["task_instance"].xcom_push(key="approverId", value="visardan-" + 
random.choice(string.ascii_letters))
       return response.json()[0]['status']
   
   
   wait_for_approval = PythonSensor(
       task_id="wait_for_approval_debug",
       python_callable=wait_for_approval,
       dag=dag,
       poke_interval=30,
       provide_context=True,
       executor_config={"KubernetesExecutor": {"image": 
"apache/airflow:1.10.12-python3.6"}}
   )
   
   start >> wait_for_approval
   ```
   
   ```json
   {
       "run_id":"run-eventId109bnfghak2",
       "conf":{
           "softwareId":"something"
       },
       "execution_date": "2020-11-04 10:38:43" //any future execution date
   }
   ```
   
   The first task executes fine but the dag is stuck at second task. I can see 
the worker pod spun up and getting completed but the task status never gets 
updated and ui still says queued and dag is always in running state due to this.
   
   ![Screen Shot 2020-11-04 at 5 02 22 
PM](https://user-images.githubusercontent.com/25412835/98112292-f7398800-1ec7-11eb-978d-ada384b0ac81.png)
   
   ![Screen Shot 2020-11-04 at 5 04 47 
PM](https://user-images.githubusercontent.com/25412835/98112298-fbfe3c00-1ec7-11eb-8cea-a1699d5b03cc.png)
   
   


----------------------------------------------------------------
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]


Reply via email to