You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "rawwar (via GitHub)" <gi...@apache.org> on 2025/04/01 08:06:45 UTC

[PR] check if stand alone dag processor is active in get_health endpoint [airflow]

rawwar opened a new pull request, #48612:
URL: https://github.com/apache/airflow/pull/48612

   If I have a stand alone dag-processor  and I turn it off later, health metrics will keep showing that the dag-processor is unhealthy. This PR fixes it to show None to indicate dag-processor no longer exists


-- 
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


Re: [PR] check if stand alone dag processor is active in get_health endpoint [airflow]

Posted by "rawwar (via GitHub)" <gi...@apache.org>.
rawwar commented on PR #48612:
URL: https://github.com/apache/airflow/pull/48612#issuecomment-2768594781

   > > If I have a stand alone dag-processor and I turn it off later
   > 
   > In Airflow 3 we support only standalone dag processor so you won't be able to turn it off. https://lists.apache.org/thread/cx1mg5g1pw4k1km56hzr06d0o39kdk8d
   
   Sorry. This is for 2.x. I raised the PR to 2.x only


-- 
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


Re: [PR] [Airflow 2.x] check if stand alone dag processor is active in get_health endpoint [airflow]

Posted by "rawwar (via GitHub)" <gi...@apache.org>.
rawwar commented on PR #48612:
URL: https://github.com/apache/airflow/pull/48612#issuecomment-2777492182

   Converting to draft as I need to fix tests and I can't work on it right now.


-- 
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


Re: [PR] check if stand alone dag processor is active in get_health endpoint [airflow]

Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal commented on PR #48612:
URL: https://github.com/apache/airflow/pull/48612#issuecomment-2768548962

   > If I have a stand alone dag-processor and I turn it off later
   
   In Airlfow 3 we support only standalone dag processor so you won't be able to turn it off.
   https://lists.apache.org/thread/cx1mg5g1pw4k1km56hzr06d0o39kdk8d
   


-- 
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


Re: [PR] [Airflow 2.x] check if stand alone dag processor is active in get_health endpoint [airflow]

Posted by "rawwar (via GitHub)" <gi...@apache.org>.
rawwar commented on code in PR #48612:
URL: https://github.com/apache/airflow/pull/48612#discussion_r2024168247


##########
airflow/api/common/airflow_health.py:
##########
@@ -61,7 +62,9 @@ def get_airflow_health() -> dict[str, Any]:
     try:
         latest_dag_processor_job = DagProcessorJobRunner.most_recent_job()
 
-        if latest_dag_processor_job:
+        standalone_dag_processor_exists = conf.getboolean("scheduler", "standalone_dag_processor")
+
+        if standalone_dag_processor_exists and latest_dag_processor_job:

Review Comment:
   stacked it



-- 
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


Re: [PR] [Airflow 2.x] check if stand alone dag processor is active in get_health endpoint [airflow]

Posted by "bugraoz93 (via GitHub)" <gi...@apache.org>.
bugraoz93 commented on code in PR #48612:
URL: https://github.com/apache/airflow/pull/48612#discussion_r2024166388


##########
airflow/api/common/airflow_health.py:
##########
@@ -61,7 +62,9 @@ def get_airflow_health() -> dict[str, Any]:
     try:
         latest_dag_processor_job = DagProcessorJobRunner.most_recent_job()
 
-        if latest_dag_processor_job:
+        standalone_dag_processor_exists = conf.getboolean("scheduler", "standalone_dag_processor")
+
+        if standalone_dag_processor_exists and latest_dag_processor_job:

Review Comment:
   ```suggestion
           if conf.getboolean("scheduler", "standalone_dag_processor") and latest_dag_processor_job:
   ```
   I think we don't need to persist this in a variable. There is no need to put it in the heap :)



-- 
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


Re: [PR] [Airflow 2.x] check if stand alone dag processor is active in get_health endpoint [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun merged PR #48612:
URL: https://github.com/apache/airflow/pull/48612


-- 
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