Skip to content

Commit

Permalink
dag processor manager, add retry_db_transcation to _fetch_callbacks (#…
Browse files Browse the repository at this point in the history
…30079)

* dag processor manager, add retry_db_transcation to _fetch_callbacks

* dag processor manager, create separate method to fetch callbacks with retries to split up provide_session and retry_db_transaction
  • Loading branch information
michaelmicheal committed Mar 22, 2023
1 parent 5d1f201 commit 1f2b0c2
Showing 1 changed file with 5 additions and 0 deletions.
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 @@ -687,6 +688,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:
Expand Down

0 comments on commit 1f2b0c2

Please sign in to comment.