Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dag processor manager, add retry_db_transcation to _fetch_callbacks #30079

Merged
merged 2 commits into from
Mar 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions airflow/dag_processing/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
reap_process_group,
set_new_process_group,
)
from airflow.utils.retries import retry_db_transaction
from airflow.utils.session import NEW_SESSION, provide_session
from airflow.utils.sqlalchemy import prohibit_commit, skip_locked, with_row_locks

Expand Down Expand Up @@ -679,6 +680,10 @@ def _run_parsing_loop(self):

@provide_session
def _fetch_callbacks(self, max_callbacks: int, session: Session = NEW_SESSION):
self._fetch_callbacks_with_retries(max_callbacks, session)

@retry_db_transaction
def _fetch_callbacks_with_retries(self, max_callbacks: int, session: Session):
"""Fetches callbacks from database and add them to the internal queue for execution."""
self.log.debug("Fetching callbacks from the database.")
with prohibit_commit(session) as guard:
michaelmicheal marked this conversation as resolved.
Show resolved Hide resolved
Expand Down