#213 Avoid calling of dns_zonemgr_releasezone explicitly
Closed by pemensik. Opened by pemensik.
pemensik/bind-dyndb-ldap zonemgr_releasezone  into  master

Use dns_zone_detach only, it would call it once all references are
removed. Would avoid removing such zone before other users stop using
it. Relies on zone_shutdown internal bind asynchronous call to release
that zone after all users detached from it.

Attempts to fix an issue reported in bug https://bugzilla.redhat.com/show_bug.cgi?id=2101712

dns_zonemgr_releasezone should be called only when all users detached from the zone. It would call releasezone asynchronously from https://gitlab.isc.org/isc-projects/bind9/-/blob/main/lib/dns/zone.c#L15028, I think it is not required to call it explicitly and so early.

Last change to dns_zonemgr_releasezone were done in commit 96f795180d182bcc008159e5ce0102af9fc8324f, which is very old change. I think it might not be required anymore this explicit way, even in bind 9.11.

Thank you, Petr. What about the other use in create_zone() in src/ldap_helper.c?

I would leave the use in create_zone as it is. It is added in the same call by dns_zonemgr_managezone(). I think manual call in this case will ensure dns_zone_detach() will release the zone immediately and not by asynchronous task later. That is wanted in case of failed task.

Closing this, it was attempt done on the wrong side. It might be still required to decrease zones reference counter, without it would destroy not be called.

Pull-Request has been closed by pemensik

Metadata