On Mon, Nov 28, 2022 at 12:53:16PM +0000, Marcus Kool wrote:
> In a test setup there are two instances of the same plugin and everything
> works as expected (plugin_register is called twice - once for each view).
> 
> However, "rndc reconfig" calls plugin_register again twice but does not call
> plugin_destroy...

Are you sure it's not being run?

> So, does anyone know when plugin_destroy is called and perhaps how a plugin
> can detect a reconfig is done and can deallocate resources for the plugins
> registered at startup?

For each view, "rndc reconfig" is supposed to create and configure a new view,
move the zones from the old view to the new one, and then destroy the one.
The destroy function for the view should clean up plugins:

|       if (view->plugins != NULL && view->plugins_free != NULL) {
|               view->plugins_free(view->mctx, &view->plugins);
|       }

view->plugins_free is a pointer to ns_plugins_free(), which calls
unload_plugin() for each plugin configured in the view, and that calls
the plugin_destroy() function defined in the module.

If you have the logging level set to debug(1), you should see "unloading
plugin" in your log file when this happens.

-- 
Evan Hunt -- e...@isc.org
Internet Systems Consortium, Inc.
-- 
Visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from 
this list

ISC funds the development of this software with paid support subscriptions. 
Contact us at https://www.isc.org/contact/ for more information.


bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users

Reply via email to