Skip to content

AWS BatchOperator does not fetch log entries for deferred jobs #54561

@delagoya

Description

@delagoya

Apache Airflow Provider(s)

amazon

Versions of Apache Airflow Providers

apache-airflow-providers-amazon 9.0.0

Apache Airflow version

2.10.3

Operating System

Amazon Linux 2

Deployment

Amazon (AWS) MWAA

Deployment details

Default deployment + IAM permissions for AWS Batch for the MWAA execution role.

What happened

Using the BatchOperator to run a AWS Batch job as a deferred task, the logs are not retrieved despite setting the awslogs_enabled parameter to true.

CloudWatch log stream entries for the Batch job are only able to be brought into the Airflow console when the Airflow task is not deferred. This is due to the fetch functionality only implemented in the monitor_job function, which is only called when a job is not deferred.

What you think should happen instead

At the end of a deferred job, the CloudWatch log stream entries should be fetched and brought into the console if awslogs_enabled is set to true.

How to reproduce

Run any dag that has a deferred task using the BatchOperator.

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions