Skip to content

Commit 6cde25f

Browse files
Move [scheduler]dag_dir_list_interval to [dag_bundles]refresh_interval (#45722)
This config should be the default refresh_interval in AF3, so move its predecesor.
1 parent 5f7269c commit 6cde25f

File tree

6 files changed

+19
-15
lines changed

6 files changed

+19
-15
lines changed

airflow/config_templates/config.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -2286,13 +2286,6 @@ scheduler:
22862286
type: integer
22872287
example: ~
22882288
default: "50"
2289-
dag_dir_list_interval:
2290-
description: |
2291-
How often (in seconds) to scan the DAGs directory for new files. Default to 5 minutes.
2292-
version_added: ~
2293-
type: integer
2294-
example: ~
2295-
default: "300"
22962289
print_stats_interval:
22972290
description: |
22982291
How often should stats be printed to the logs. Setting to 0 will disable printing stats
@@ -2681,7 +2674,7 @@ dag_bundles:
26812674
description: |
26822675
List of backend configs. Must supply name, classpath, and kwargs for each backend.
26832676
2684-
By default, ``refresh_interval`` is set to ``[scheduler] dag_dir_list_interval``, but that can
2677+
By default, ``refresh_interval`` is set to ``[dag_bundles] refresh_interval``, but that can
26852678
also be overridden in kwargs if desired.
26862679
26872680
The default is the dags folder dag bundle.
@@ -2711,3 +2704,10 @@ dag_bundles:
27112704
"kwargs": {{}}
27122705
}}
27132706
]
2707+
refresh_interval:
2708+
description: |
2709+
How often (in seconds) to refresh, or look for new files, in a DAG bundle.
2710+
version_added: ~
2711+
type: integer
2712+
example: ~
2713+
default: "300"

airflow/config_templates/unit_tests.cfg

-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ result_backend = db+mysql://airflow:airflow@localhost:3306/airflow
8888
job_heartbeat_sec = 1
8989
scheduler_heartbeat_sec = 5
9090
parsing_processes = 2
91-
dag_dir_list_interval = 0
9291

9392
[triggerer]
9493
# Those values are set so that during unit tests things run faster than usual.

airflow/configuration.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,9 @@ def sensitive_config_values(self) -> set[tuple[str, str]]:
324324
# A mapping of (new section, new option) -> (old section, old option, since_version).
325325
# When reading new option, the old option will be checked to see if it exists. If it does a
326326
# DeprecationWarning will be issued and the old option will be used instead
327-
deprecated_options: dict[tuple[str, str], tuple[str, str, str]] = {}
327+
deprecated_options: dict[tuple[str, str], tuple[str, str, str]] = {
328+
("dag_bundles", "refresh_interval"): ("scheduler", "dag_dir_list_interval", "3.0"),
329+
}
328330

329331
# A mapping of new section -> (old section, since_version).
330332
deprecated_sections: dict[str, tuple[str, str]] = {}

airflow/dag_processing/bundles/base.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ class BaseDagBundle(ABC):
4646

4747
supports_versioning: bool = False
4848

49-
def __init__(self, *, name: str, refresh_interval: int = 300, version: str | None = None) -> None:
49+
def __init__(
50+
self,
51+
*,
52+
name: str,
53+
refresh_interval: int = conf.getint("dag_bundles", "refresh_interval"),
54+
version: str | None = None,
55+
) -> None:
5056
self.name = name
5157
self.version = version
5258
self.refresh_interval = refresh_interval

docs/apache-airflow/administration-and-deployment/scheduler.rst

-3
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,6 @@ However, you can also look at other non-performance-related scheduler configurat
354354
queued tasks that were launched by the dead process will be "adopted" and
355355
monitored by this scheduler instead.
356356

357-
- :ref:`config:scheduler__dag_dir_list_interval`
358-
How often (in seconds) to scan the DAGs directory for new files.
359-
360357
- :ref:`config:scheduler__file_parsing_sort_mode`
361358
The scheduler will list and sort the DAG files to decide the parsing order.
362359

docs/apache-airflow/best-practices.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ each parameter by following the links):
443443

444444
* :ref:`config:scheduler__scheduler_idle_sleep_time`
445445
* :ref:`config:scheduler__min_file_process_interval`
446-
* :ref:`config:scheduler__dag_dir_list_interval`
446+
* :ref:`config:dag_bundles__refresh_interval`
447447
* :ref:`config:scheduler__parsing_processes`
448448
* :ref:`config:scheduler__file_parsing_sort_mode`
449449

0 commit comments

Comments
 (0)