Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make auto refresh interval configurable #18107

Merged

Conversation

rachelwigell
Copy link
Contributor

closes: #18069

We accidentally DDOS'd our own webserver yesterday 😄 More details in the issue on how exactly this happened, but the gist is that auto-refresh can be a significant strain if there are many active tasks whose statuses must be polled. Auto-refresh is a wonderful feature but we wanted to be able to lengthen the interval to protect against this.

On main, the interval is hard-coded to 3 seconds. I'm proposing we add a new webserver config variable that will allow this interval to be customized.


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

@boring-cyborg boring-cyborg bot added area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues labels Sep 9, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented Sep 9, 2021

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (flake8, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it’s a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@msumit
Copy link
Contributor

msumit commented Sep 9, 2021

This is nice 👍. Along with this, I think it would be good to have an option (like a drop-down) near the auto-refresh control to set the refresh rate by the users themselves, which will be stored into browser's local storage or a cookie and can control a user's choice to refresh the data.

@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Sep 9, 2021
@github-actions
Copy link

github-actions bot commented Sep 9, 2021

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@rachelwigell
Copy link
Contributor Author

Along with this, I think it would be good to have an option (like a drop-down) near the auto-refresh control to set the refresh rate by the users themselves, which will be stored into browser's local storage or a cookie and can control a user's choice to refresh the data.

I agree that would be a convenient feature, but undermines the original intent of making this change which was to allow admins of an Airflow server to set a longer interval for auto-refresh so that users wouldn't be as easily able to overwhelm the webserver with large numbers of requests.

@rachelwigell rachelwigell force-pushed the 18069-configurable-auto-refresh-interval branch from 2709e6d to ae0f593 Compare September 10, 2021 02:16
@kaxil kaxil added this to the Airflow 2.2 milestone Sep 10, 2021
@kaxil kaxil merged commit a773794 into apache:main Sep 10, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented Sep 10, 2021

Awesome work, congrats on your first merged pull request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues full tests needed We need to run full set of tests for this PR to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move auto-refresh interval to config variable
5 participants