Skip to content

openlineage: Non-local executor's initializer breaking the Airflow DB connection #40403

Description

@kacpermuda

Apache Airflow Provider(s)

openlineage

Versions of Apache Airflow Providers

apache-airflow-providers-openlineage==1.9.0rc1

or simply main branch for now.

Apache Airflow version

main branch (breeze), 2.9.1 (Astro)

Operating System

MacOS Sonoma 14.5

Deployment

Other

Deployment details

I tested this both on breeze and Astro cloud.

What happened

Changing the initializer from local function ProcessPoolExecutor to a separate function (implemented in #40353), to avoid pickling error in airflow standalone described in #40309, indeed works for airflow standalone, but it's causing the scheduler crash when trying to build AirflowStateRunFacet (introduced in #39520) when it's calling the Airflow DB.

Attaching some scheduler logs i got when running a simple DAG multiple times:
error2.txt
error3.txt
error4.txt
error5.txt

I've also seen this "Unexpected commit" error being raised, but don't have logs saved for that.

What you think should happen instead

I do not fully understand what's happenning there when initializing the executor, and why such a small change can cause problems here.

How to reproduce

Run some DAG with apache-airflow-providers-openlineage==1.9.0rc1 installed, f.e.

importdatetimeasdtfromairflowimportDAGfromairflow.operators.bashimportBashOperatorwithDAG(
dag_id='dag',
start_date=dt.datetime(2024, 5, 21),
schedule=None
) asdag:
task_0=BashOperator(
task_id="task_0",
bash_command="exit 0;",
)
task_1=BashOperator(
task_id="task_1",
bash_command="exit 1;"
)

You should receive no DAG level event after dagrun completion and the scheduler will crash.

Anything else

I prepared a PR reverting the change that's causing the problem: #40402, but i want to understand what's happenning and how I can prepare the fix that will actually work.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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