Skip to content

Add lock to BaseDagBundle and use it in GitDagBundle#46501

Merged
ephraimbuddy merged 2 commits intoapache:mainfrom
astronomer:bundle_locking
Feb 6, 2025
Merged

Add lock to BaseDagBundle and use it in GitDagBundle#46501
ephraimbuddy merged 2 commits intoapache:mainfrom
astronomer:bundle_locking

Conversation

@jedcunningham
Copy link
Copy Markdown
Member

initialize and refresh need to be safe to call from different threads/processes, so this adds a simple lock context manager that bundles can use if the underlying implementation doesn't allow for that.

For example, GitDagBundle is the first taker.

closes: #46444

`initialize` and `refresh` need to be safe to call from different
threads/processes, so this adds a simple `lock` context manager that
bundles can use if the underlying implementation doesn't allow for that.

For example, `GitDagBundle` is the first taker.
@jedcunningham jedcunningham added full tests needed We need to run full set of tests for this PR to merge AIP-66: DAG Bundle/Manifest labels Feb 6, 2025
@ephraimbuddy ephraimbuddy merged commit 96f6416 into apache:main Feb 6, 2025
91 checks passed
@ephraimbuddy ephraimbuddy deleted the bundle_locking branch February 6, 2025 11:00
insomnes pushed a commit to insomnes/airflow that referenced this pull request Feb 6, 2025
)

* Add `lock` to `BaseDagBundle` and use it in `GitDagBundle`

`initialize` and `refresh` need to be safe to call from different
threads/processes, so this adds a simple `lock` context manager that
bundles can use if the underlying implementation doesn't allow for that.

For example, `GitDagBundle` is the first taker.

* review feedback
niklasr22 pushed a commit to niklasr22/airflow that referenced this pull request Feb 8, 2025
)

* Add `lock` to `BaseDagBundle` and use it in `GitDagBundle`

`initialize` and `refresh` need to be safe to call from different
threads/processes, so this adds a simple `lock` context manager that
bundles can use if the underlying implementation doesn't allow for that.

For example, `GitDagBundle` is the first taker.

* review feedback
ambika-garg pushed a commit to ambika-garg/airflow that referenced this pull request Feb 17, 2025
)

* Add `lock` to `BaseDagBundle` and use it in `GitDagBundle`

`initialize` and `refresh` need to be safe to call from different
threads/processes, so this adds a simple `lock` context manager that
bundles can use if the underlying implementation doesn't allow for that.

For example, `GitDagBundle` is the first taker.

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

Labels

AIP-66: DAG Bundle/Manifest area:DAG-processing full tests needed We need to run full set of tests for this PR to merge

Projects

Development

Successfully merging this pull request may close these issues.

Add locking for bundle initialize on workers

3 participants