when can confd_notification_ctx get corrupted and is there a way to check if confd_notification_ctx pointer is appropriate before calling confd_notification_send ?
when can confd_notification_ctx get corrupted and is there a way to check if confd_notification_ctx pointer is appropriate before calling confd_notification_send ?
Well, not really corrupted, but when you call confd_release_daemon()
, all confd_notification_ctx’s for the daemon will be de-allocated and thus unusable,
Not if it the memory it points to has been free()d - you will access basically random data whatever you do. When confd_release_daemon()
is called (and a new daemon initialized), you need to make sure that confd_register_notification_stream()
etc is called again for the new daemon, to obtain a new confd_notification_ctx.
Thanks Per. I am getting “Daemon cpp_confd_agent timed out” in confd.log and “Worker socket query timed out daemon cpp_confd_agent id 6 in my confd” for my local devel log. Can you please tell me what does this signify.
It means that ConfD sent a callback request to your daemon (if you use developerLogLevel “trace” in confd.conf you should be able to see which request it was), and didn’t receive a reply within the time specified for /confdConfig/capi/queryTimeout. ConfD will then consider your daemon hung or dead and close all the socket connections to it. This can’t per se explain your problem with the confd_notification_ctx though, but if you call confd_release_daemon() when you notice the socket close (and don’t obtain a new confd_notification_ctx), that could cause it.