Lorenzo-N opened a new issue, #30910:
URL: https://github.com/apache/airflow/issues/30910

   ### Apache Airflow version
   
   2.5.3
   
   ### What happened
   
   Hi, I updated airflow from version 2.2.0 to version 2.5.3.
   I developed an airflow plugin that adds some REST API by implementing a 
flask_blueprint and in version 2.2.0 I could develop the plugin using the 
environment parameter **reload_on_plugin_change=True**. Updating to v2.5.3 this 
parameter seems to have no effect anymore, and if I change the plugin the 
changes are not updated until I restart the webserver.
   
   ### What you think should happen instead
   
   I expect plugins to be reloaded upon change if the parameter 
**reload_on_plugin_change** is set to true.
   
   ### How to reproduce
   
   - Set in the env the parameter **reload_on_plugin_change=True**.
   - Develop a plugin that implements an api (I also tried the example plugin 
described here in the documentation 
[https://airflow.apache.org/docs/apache-airflow/2.5.3/authoring-and-scheduling/plugins.html#example](https://airflow.apache.org/docs/apache-airflow/2.5.3/authoring-and-scheduling/plugins.html#example)).
   - Edit the plugin and reload the interface. The plugin is not updated.
   
   ### Operating System
   
   Extension of official Docker image apache/airflow:2.5.3-python3.10
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Docker-Compose
   
   ### Deployment details
   
   _No response_
   
   ### Anything else
   
    I investigated the cause of the problem and it seems to be due to the 
[**--preload**](https://github.com/apache/airflow/blob/main/airflow/cli/commands/webserver_command.py#L427)
 parameter that is added to the gunicorn args. In fact, the workers are 
restarted when one of the plugin files changes, but the plugins are not updated 
(in my opinion because the parameter shares the app among all the workers so 
the plugins are not reloaded). Launching the webserver with the **--debug** 
parameter correctly reloads the plugins, however, I would like to use the 
gunicorn in development to test its correct operation as well.
   In my opinion a solution might be not to pass the **--preload** parameter to 
the gunicorn if the variable **reload_on_plugin_change** is set, so that the 
plugins are reloaded correctly.
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to