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

fix: Stabilize and deprecate legacy alerts module #12627

Merged
merged 2 commits into from
Jan 21, 2021

Conversation

robdiciuccio
Copy link
Member

SUMMARY

We are seeing exponential growth of alert.run_query tasks in our Celery queues, likely due to the permissive scheduling window combined with multiple task retries. This PR 1) reduces the schedule window from 1hr to a few minutes, 2) reduces the retry count from 5 to 1, and 3) removes the arbitrary soft_time_limit value.

Also adding a deprecation notice to this module, as it's been replaced by #11711

TEST PLAN

Alert scheduling should function without exponential growth of celery task queues.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

@codecov-io
Copy link

codecov-io commented Jan 20, 2021

Codecov Report

Merging #12627 (5223f0d) into master (10c2b09) will decrease coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #12627      +/-   ##
==========================================
- Coverage   66.79%   66.72%   -0.07%     
==========================================
  Files        1015     1017       +2     
  Lines       49673    49734      +61     
  Branches     4845     4864      +19     
==========================================
+ Hits        33179    33187       +8     
- Misses      16372    16424      +52     
- Partials      122      123       +1     
Flag Coverage Δ
cypress 50.99% <ø> (-0.01%) ⬇️
javascript 60.80% <ø> (+0.06%) ⬆️
python 63.85% <100.00%> (-0.15%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset/tasks/schedules.py 76.36% <100.00%> (ø)
superset/db_engine_specs/presto.py 73.37% <0.00%> (-8.66%) ⬇️
superset/db_engines/hive.py 82.14% <0.00%> (-3.58%) ⬇️
superset/models/core.py 88.58% <0.00%> (-0.28%) ⬇️
...ard/components/nativeFilters/FilterConfigModal.tsx 62.80% <0.00%> (-0.23%) ⬇️
superset-frontend/src/common/components/index.tsx 100.00% <0.00%> (ø)
superset-frontend/src/dashboard/reducers/types.ts 0.00% <0.00%> (ø)
...dashboard/components/nativeFilters/FilterScope.tsx 76.92% <0.00%> (ø)
...rset-frontend/src/explore/components/SaveModal.tsx 91.01% <0.00%> (+0.31%) ⬆️
...dashboard/components/nativeFilters/ScopingTree.tsx 81.81% <0.00%> (+4.04%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 10c2b09...5223f0d. Read the comment docs.

Copy link
Member

@dpgaspar dpgaspar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM just a non blocking comment

@@ -844,8 +846,8 @@ def schedule_alerts() -> None:
resolution = 0
now = datetime.utcnow()
start_at = now - timedelta(
seconds=3600
) # process any missed tasks in the past hour
seconds=300
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be nice to have this on a config flag

@robdiciuccio robdiciuccio merged commit e4ae17d into apache:master Jan 21, 2021
@robdiciuccio robdiciuccio deleted the rd/alert-scheduler-tweaks branch January 21, 2021 17:51
henryyeh pushed a commit to preset-io/superset that referenced this pull request Jan 21, 2021
* Add deprecation notice to superset.tasks.schedules

* Reduce retries and schedule window for alerts

(cherry picked from commit e4ae17d)
henryyeh pushed a commit to preset-io/superset that referenced this pull request Jan 25, 2021
* Add deprecation notice to superset.tasks.schedules

* Reduce retries and schedule window for alerts

(cherry picked from commit e4ae17d)
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.2.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels preset-io size/S 🚢 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants