Skip to content

AirflowInactiveAssetInInletOrOutletException is flaky #58303

@kacpermuda

Description

@kacpermuda

Apache Airflow version

3.1.2

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

Happens since 3.0

What happened?

When running DAG (this) that has tasks with inlets and outlets that are not consumed anywhere the AirflowInactiveAssetInInletOrOutletException is raised, but only sometimes, every few days.

Image

These are my tests that run daily, and you can see that these failures look rather random (task2 is the one with "inactive" inlets). Also, whenever a failure happens and I create a new DagRun straight away, it passes without error.
Image

Inlets/outlets are not consumed - it means that inlets to a single task are not outlets of any other task in my entire Airflow, the same for outlets - they are not inlets to any other task in my entire Airflow. I thought it's not a requirement, a task should be able to emit Asset regardless. These inlets and outlets are used in tasks so that I can check how the OpenLineage is serializing them into OL events, so I can't simply remove them.

What you think should happen instead?

I think no error should be raised and I should be able to define inlets/outlets to my tasks that are not defined anywhere else. If, however, It's considered a wrong behavior, errors should always be raised so it's consistent.

How to reproduce

That's a hard one to reproduce quickly. I could say: run a DAG with inlet that has some non-existing uri, every day for a week, and see if it raises an error.

I assume maybe it's "flakiness" comes from some internal process that clears AssetActive table or something similar? Really hard to say, I tried to follow the code, ended up here in API's validate_inlets_and_outlets, but I still can't figure out why my inlet is not in the AssetActive table (maybe it's not being inserted properly when dag is parsed?)

Operating System

linux

Versions of Apache Airflow Providers

No response

Deployment

Astronomer

Deployment details

Running on Airflow 3.0 and 3.1, it has been happening since the release of AF3 really, so I'm not sure if any recent change is the cause of it.

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions