bind9/bin/named
Colin Vidal d7dbfbb011 apply_configuration: leave exclusive mode after viewlist cleanup
When a re-configuration fails, `apply_configuration` flows jump to a
cleanup label and, at some point, leave the exclusive mode and cleanup
the viewlist. It looks fine as the viewlist is at this point only
locally known (if this is a configuration failure, this is the new view
list, if this is a success, this is the old list which has been swapped
out from the production list during the exclusive mode).

However, the view and zone initialization code enqueues job callbacks,
for instance from `dns_zone_setsigninginterval` (but there are others
cases) which will be called for the new views and zones after the
exclusive mode is over.

Depending where the configuration fails, those views and zones can be
half-configured, for instance a view might have an unfrozen resolver.
Hence, leaving the exclusive mode before cleaning up those views ans
zones will immediately called the previously enqueued callbacks and lead
to this reconfiguration-failure crash stack:

```
isc_assertion_failed
dns_resolver_createfetch
do_keyfetch
isc__async_cb
...
uv_run
loop_thread
thread_body
thread_run
start_thread
...
```

To avoid the problem, the views are now cleaned up before leaving the
exclusive mode (which also clean up the zones and enqueued callbacks).

As context, the bug was introduced by !10910 which moved the creation
(not configuration) of the view outsides of the exclusive mode. This is
a safe move (as at this point, the newly view are only known locally by
`apply_configuration`) but the re-order was wrong regarding the point
where the exclusive mode was ended (before the change, the exclusive
mode as always ended before the new view are detached).
2025-09-26 14:55:01 +02:00
..
include rename cfg_aclconfctx_t variables to aclctx 2025-09-24 20:14:49 +02:00
.gitignore Complete rewrite the BIND 9 build system 2020-04-21 14:19:48 +02:00
bind9.xsl Expose the incoming transfers' rates in the statistics channel 2025-02-20 09:32:55 +00:00
builtin.c make getoriginnode implementation optional 2025-09-15 16:11:50 +00:00
config.c Remove the random ordering of resource records in RRset 2025-09-08 14:04:13 +02:00
control.c Add and use global memory context called isc_g_mctx 2025-08-04 11:29:26 +02:00
controlconf.c rename cfg_aclconfctx_t variables to aclctx 2025-09-24 20:14:49 +02:00
dlz_dlopen_driver.c Use clang-format-20 to update formatting 2025-06-25 12:44:22 +10:00
fuzz.c Change the loopmgr to be singleton 2025-07-23 22:44:16 +02:00
geoip.c Remove redundant parentheses from the return statement 2024-11-19 12:27:22 +01:00
log.c debug level was ignored when logging to stderr 2025-05-13 12:47:23 -07:00
logconf.c Use ControlStatementsExceptControlMacros for SpaceBeforeParens 2025-08-19 07:58:33 +02:00
main.c Implement '-T slowrpz' named testing option 2025-08-22 16:31:17 +00:00
meson.build replace the build system with meson 2025-06-11 10:30:12 +03:00
named.conf.rst Remove the configblock sphinx extension 2025-06-23 13:45:09 +03:00
named.rst Finalize removal of memory debug flags size and mctx 2024-12-06 02:29:20 +00:00
os.c implement the systemd notification protocol manually, drop libsystemd 2025-03-27 22:52:41 +03:00
server.c apply_configuration: leave exclusive mode after viewlist cleanup 2025-09-26 14:55:01 +02:00
statschannel.c rename cfg_aclconfctx_t variables to aclctx 2025-09-24 20:14:49 +02:00
tkeyconf.c Obsolete the "tkey-domain" statement 2025-09-01 21:35:33 +02:00
transportconf.c Use ControlStatementsExceptControlMacros for SpaceBeforeParens 2025-08-19 07:58:33 +02:00
tsigconf.c Use ControlStatementsExceptControlMacros for SpaceBeforeParens 2025-08-19 07:58:33 +02:00
xsl_c.in replace the build system with meson 2025-06-11 10:30:12 +03:00
xsl_p.h Update the copyright information in all files in the repository 2022-01-11 09:05:02 +01:00
zoneconf.c rename cfg_aclconfctx_t variables to aclctx 2025-09-24 20:14:49 +02:00