-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
feat: Implement Celery SoftTimeLimit handling #13740
Conversation
Codecov Report
@@ Coverage Diff @@
## master #13740 +/- ##
==========================================
+ Coverage 79.40% 79.43% +0.03%
==========================================
Files 938 938
Lines 47541 47553 +12
Branches 5940 5940
==========================================
+ Hits 37749 37774 +25
+ Misses 9666 9653 -13
Partials 126 126
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
1b6ec9b
to
27d98f5
Compare
@dpgaspar would you mind taking a look at this? |
superset/reports/commands/alert.py
Outdated
@@ -146,7 +146,8 @@ def _execute_query(self) -> pd.DataFrame: | |||
rendered_sql, ALERT_SQL_LIMIT | |||
) | |||
return self._report_schedule.database.get_df(limited_rendered_sql) | |||
except SoftTimeLimitExceeded: | |||
except SoftTimeLimitExceeded as ex: | |||
logger.error("A timeout occurred while executing the alert query: %s", ex) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to log the errors - this is somewhat expected behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, logging has a warning is probably better, left a couple of comments also
superset/tasks/scheduler.py
Outdated
@@ -67,6 +68,8 @@ def execute(report_schedule_id: int, scheduled_dttm: str) -> None: | |||
AsyncExecuteReportScheduleCommand(report_schedule_id, scheduled_dttm_).run() | |||
except ReportScheduleUnexpectedError as ex: | |||
logger.error("An unexpected occurred while executing the report: %s", ex) | |||
except SoftTimeLimitExceeded as ex: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this is probably unnecessary because we already catch and reraise it here: https://github.com/apache/superset/blob/master/superset/reports/commands/execute.py#L183
superset/sql_lab.py
Outdated
logger.error("Query %d: Time limit exceeded", query_id) | ||
logger.debug("Query %d: %s", query_id, ex) | ||
raise SqlLabTimeoutException( | ||
"SQL Lab timeout. This environment's policy is to kill queries " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this error goes to the user we should translate it using flask babel
6a7b823
to
d291ec3
Compare
d291ec3
to
009c43a
Compare
* master: fix: unable to apply logging format (#14074) refactor: Bootstrap to AntD - Slider (#13989) chore(spa refactor): refactoring dashboard to use api's instead of bootstrapdata (#13306) fix(listview): update listview feature flag (#13906) Add docs for configuring Docker Compose setup (#13961) feat: invalid password error message (Postgres) (#14038) fix: flacky test in test_update_dataset_item_w_override_columns (#14082) feat: Implement Celery SoftTimeLimit handling (#13740) feat: only send alert error emails to owners of the alert (#13862) feat: add descriptions to report emails (#13827) Make chart exclude itself from cross filtering (#14046) fix: fix bug when remove chart not removing it's related cross filter data (#14081) feat(native-filters): Add default first value to select filter (#13726) feat: Make async query JWT cookie domain configurable (#14007) fix: add exception to catch session not having JWT (#14036) # Conflicts: # superset-frontend/src/dashboard/actions/hydrate.js # superset/views/core.py
* master: (53 commits) test: Adds tests to the UndoRedoKeyListeners component (#13919) chore: Adds dataMask reducer to reducerIndex (#13951) test: Tests audit for the Dashboard FilterBar (#13916) fix: unable to apply logging format (#14074) refactor: Bootstrap to AntD - Slider (#13989) chore(spa refactor): refactoring dashboard to use api's instead of bootstrapdata (#13306) fix(listview): update listview feature flag (#13906) Add docs for configuring Docker Compose setup (#13961) feat: invalid password error message (Postgres) (#14038) fix: flacky test in test_update_dataset_item_w_override_columns (#14082) feat: Implement Celery SoftTimeLimit handling (#13740) feat: only send alert error emails to owners of the alert (#13862) feat: add descriptions to report emails (#13827) Make chart exclude itself from cross filtering (#14046) fix: fix bug when remove chart not removing it's related cross filter data (#14081) feat(native-filters): Add default first value to select filter (#13726) feat: Make async query JWT cookie domain configurable (#14007) fix: add exception to catch session not having JWT (#14036) Use consistent chart value (#14031) fix: Use superset generic db to catch external_metadata queries (#13974) ...
* log soft time limit error * lint * update test
* log soft time limit error * lint * update test
SUMMARY
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TEST PLAN
ADDITIONAL INFORMATION