docker-vernemq
docker-vernemq copied to clipboard
on_client_offline not triggered by shutdown
Environment
- VerneMQ Version: 1.12.x
Expected behaviour
I expect the on_client_offline hook to be called when a client session is terminated because of a node shutdown.
This was the case up until and including version 1.11.0.
Actual behaviour
The on_client_offline hook is not called anymore in version 1.12.0 in later when the node is shutdown.
Additional information
I tracked the change in behavior down to the sigterm_handler. Commit 58dc85f41c6a8404c3504c97b2d923d095483490 (https://github.com/vernemq/docker-vernemq/commit/58dc85f41c6a8404c3504c97b2d923d095483490) removed this:
/vernemq/bin/vmq-admin cluster leave node=$terminating_node_name -k > /dev/null
Adding these back in restores the previous behavior. So, it seems that the hook is triggered by how client sessions are terminated on cluster leave but not on node stop.
c.f. https://github.com/vernemq/vernemq/issues/2003