Bug description
I noticed that Superset worker is not gracefully shuts down when it is deployed to k8s, as a result a celery signal worker_shutdown is never triggered and tasks can be aborted without let them to complete. Also due to this issue workers status keeps as online while should be marked as offline on pod termination.
I tried both celery signals and SIGINT for bash and python and it is not catching the process termination.
Also I noticed that worker deployment (helm/superset/templates/deployment-worker.yaml) has no lifecycle preStop command. As soon as I added lifecycle preStop as this celery --app=superset.tasks.celery_app:app control shutdown --destination=celery@$HOSTNAME it solves the issue with gracefull shutdown.
Please add lifecycle preStop to the worker deployment-worker.yaml and/or values.yaml
Here is my patch I used with kubectl:
spec:
template:
spec:
containers:
- name: {{ .Chart.Name }}
lifecycle:
preStop:
exec:
command:
- /bin/sh
- '-c'
- celery --app=superset.tasks.celery_app:app control shutdown --destination=celery@$HOSTNAME
Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist
Bug description
I noticed that Superset worker is not gracefully shuts down when it is deployed to k8s, as a result a celery signal worker_shutdown is never triggered and tasks can be aborted without let them to complete. Also due to this issue workers status keeps as online while should be marked as offline on pod termination.
I tried both celery signals and SIGINT for bash and python and it is not catching the process termination.
Also I noticed that worker deployment (helm/superset/templates/deployment-worker.yaml) has no lifecycle preStop command. As soon as I added lifecycle preStop as this
celery --app=superset.tasks.celery_app:app control shutdown --destination=celery@$HOSTNAMEit solves the issue with gracefull shutdown.Please add lifecycle preStop to the worker deployment-worker.yaml and/or values.yaml
Here is my patch I used with kubectl:
Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist