Skip to content

Give up sending a worker-offline message if transport is not connected#6039

Merged
auvipy merged 2 commits into
celery:masterfrom
Alphadelta14:improvement/giveup-worker-offline
Apr 15, 2020
Merged

Give up sending a worker-offline message if transport is not connected#6039
auvipy merged 2 commits into
celery:masterfrom
Alphadelta14:improvement/giveup-worker-offline

Conversation

@Alphadelta14

Copy link
Copy Markdown
Contributor

Description

If a celery worker is segmented from a cluster and is told to die, it will try very aggressively to connect to the transport that may or not exist at this point. This can add a bit of time to shutdown procedures and usually ends up just getting sigkill'd by the init/supervisor regardless.
This change makes it so that the worker-offline is still sent, but if it is lost, just accept it and die peacefully by setting retry=False on the worker-offline message.
In cases where a cluster is still fully operational from the segmented worker, it will track the worker as lost by heartbeats instead of the offline message.

@auvipy auvipy added this to the 4.4.x milestone Apr 15, 2020