Replies: 2 comments 2 replies
-
To configure Superset 4.0.2 to avoid multiple executions by both workers and prevent receiving duplicate emails for the same report, you can set the Here is the relevant configuration: # Enable the timeout kill to prevent multiple executions
ALERT_REPORTS_WORKING_TIME_OUT_KILL = True
# Set the hard timeout lag (in seconds)
ALERT_REPORTS_WORKING_TIME_OUT_LAG = int(timedelta(seconds=10).total_seconds())
# Set the soft timeout lag (in seconds)
ALERT_REPORTS_WORKING_SOFT_TIME_OUT_LAG = int(timedelta(seconds=1).total_seconds()) Additionally, ensure that the FEATURE_FLAGS = {
"ALERT_REPORTS": True
} You should also configure the from celery.schedules import crontab
class CeleryConfig:
broker_url = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_CELERY_DB}"
imports = (
"superset.sql_lab",
"superset.tasks.scheduler",
"superset.tasks.thumbnails",
"superset.tasks.cache",
)
result_backend = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_RESULTS_DB}"
worker_prefetch_multiplier = 1
task_acks_late = False
beat_schedule = {
"reports.scheduler": {
"task": "reports.scheduler",
"schedule": crontab(minute="*", hour="*"),
},
"reports.prune_log": {
"task": "reports.prune_log",
"schedule": crontab(minute=10, hour=0),
},
}
CELERY_CONFIG = CeleryConfig These settings will help ensure that if a report execution takes too long, it will be killed, thus preventing multiple executions and duplicate emails [1][2][3]. |
Beta Was this translation helpful? Give feedback.
-
This configuration already set. The issue is the same job is picked up by the both the workers at the same time |
Beta Was this translation helpful? Give feedback.
-
I m using superset 4.0.2. There are two instance of superset running. Both instances connecting to same db. The report is picked up by both the workers and also i am able to see two entries for the same report in execution log table. So i m getting duplicate emails for the same report in a scheduled time. Is there any configuration required to avoid multiple execution by both the workers
Beta Was this translation helpful? Give feedback.
All reactions