[kea-dev] Is it possible for hooks to hande server shutdown?
baptiste at bitsofnetworks.org
Tue Oct 3 05:24:46 UTC 2017
On 01-10-17, Dave Cole wrote:
> I have been working on a hook to publish events to a Kafka server. The Kafka library creates a thread for communication with the server, which creates a problem when the kea server is stopped as there might still be messages that have not been delivered to the Kafka server.
> There is a simple way to monitor the Kafka thread. Is there any way for the hook to detect server shutdown and delay process termination until delivery to Kafka has completed?
Have a look at the "unload" hook point. I'm not sure what would happen if
you block too long in this function, though: the init system might get
impatient and try to forcibly kill kea.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: not available
More information about the kea-dev