nullhack opened a new issue #9172:
URL: https://github.com/apache/airflow/issues/9172


   **Apache Airflow version**: 2.0.0.dev0, 1.10.10
   
   **Environment**:
   docker container: `apache/airflow:master-ci`
   
   **What happened**:
   When using DockerOperator and setting `auto_remove=True` data is not stored 
on `xcom`
   
   **What you expected to happen**:
   I expect that the data is saved after the process and the container is 
deleted.
   
   **Code to test**
   ```python
   from airflow import DAG
   from airflow.utils.dates import days_ago
   from datetime import timedelta
   from airflow.operators.docker_operator import DockerOperator
   
   params = {
       'dag_id': 'test_autoremove',
       'schedule_interval': '@daily',
       'catchup': True,
       'max_active_runs': 2,
       'default_args': {
           'owner': 'airflow',
           'start_date': days_ago(5),
           'retries': 2,
           'retry_delay': timedelta(minutes=5)
       }
   }
   
   with DAG(**params) as dag:
   
       write_xcom_docker_warning = DockerOperator(
           task_id='write_xcom_docker_warning',
           image='python:3-slim',
           auto_remove=True,
           api_version='auto',
           command="""python -c "import logging;[print(i) for i in 
range(10)];logging.warning('this is a warning')" """,
           do_xcom_push=True,
           xcom_all=True,
           network_mode='bridge')
       
       write_xcom_docker_warning
   ```
   
   **Sample Output**
   
![image](https://user-images.githubusercontent.com/11466701/83976425-58b2f600-a92c-11ea-8abe-f137921358bc.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