Skip to content

sentry add_tagging() can take unset "task" variable #37142

@LipuFei

Description

@LipuFei

Apache Airflow version

2.8.1

If "Other Airflow 2 version" selected, which one?

No response

What happened?

Our sentry has captured this error in sentry.py:

image

image

Looks at the TaskInstance class, the task attribute has a comment saying it's not always set. I think this is the case where it's not set.

task: Operator # Not always set...

What you think should happen instead?

Sentry add_tagging() should not raise exceptions

How to reproduce

I'm not sure, but this seems to happen if a worker node is forcefully shut down when it's in the middle of running a task.

Operating System

Airflow 2.8.1 Python 3.11 Docker

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

Deployment details

On EKS.

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions