You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/12/06 08:51:18 UTC

[GitHub] [airflow] sternr commented on a diff in pull request #28128: Add retry to the scheduler loop to protect against DB hiccups

sternr commented on code in PR #28128:
URL: https://github.com/apache/airflow/pull/28128#discussion_r1040667989


##########
airflow/jobs/scheduler_job.py:
##########
@@ -880,13 +880,21 @@ def _run_scheduler_loop(self) -> None:
                     # is finished to avoid concurrent access to the DB.
                     self.log.debug("Waiting for processors to finish since we're using sqlite")
                     self.processor_agent.wait_until_finished()
-
-                with create_session() as session:
-                    num_queued_tis = self._do_scheduling(session)
-
-                    self.executor.heartbeat()
-                    session.expunge_all()
-                    num_finished_events = self._process_executor_events(session=session)
+                max_retry_count = conf.getint('scheduler', 'scheduler_loop_max_retries', fallback=5)

Review Comment:
   Since I use fallback it's not mandatory, do you prefer I add it to config template for documentation



##########
airflow/jobs/scheduler_job.py:
##########
@@ -880,13 +880,21 @@ def _run_scheduler_loop(self) -> None:
                     # is finished to avoid concurrent access to the DB.
                     self.log.debug("Waiting for processors to finish since we're using sqlite")
                     self.processor_agent.wait_until_finished()
-
-                with create_session() as session:
-                    num_queued_tis = self._do_scheduling(session)
-
-                    self.executor.heartbeat()
-                    session.expunge_all()
-                    num_finished_events = self._process_executor_events(session=session)
+                max_retry_count = conf.getint('scheduler', 'scheduler_loop_max_retries', fallback=5)

Review Comment:
   Since I use fallback it's not mandatory, do you prefer I add it to config template for documentation?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org