move creation of keystores, kasp list and view outside of exclusive mode

The keystores initialization, the KASP list initialization as well as
the initialization of the view no longer depends of any data shared by
running "production" objects during re-configuration of the server. This
allows us to move those outside (before) the exclusive mode is taken.
This commit is contained in:
Colin Vidal 2025-09-08 15:57:47 +02:00
parent 201f62d9ef
commit e1be2be4ef

View file

@ -8161,6 +8161,21 @@ apply_configuration(cfg_parser_t *configparser, cfg_obj_t *config,
goto cleanup_aclconfctx;
}
result = configure_keystores(config, &keystorelist);
if (result != ISC_R_SUCCESS) {
goto cleanup_keystorelist;
}
result = configure_kasplist(config, &kasplist, &keystorelist);
if (result != ISC_R_SUCCESS) {
goto cleanup_kasplist;
}
result = create_views(config, configparser, aclconfctx, &viewlist);
if (result != ISC_R_SUCCESS) {
goto cleanup_viewlist;
}
/* Ensure exclusive access to configuration data. */
isc_loopmgr_pause();
@ -8771,21 +8786,6 @@ apply_configuration(cfg_parser_t *configparser, cfg_obj_t *config,
*/
(void)configure_session_key(maps, server, isc_g_mctx, first_time);
result = configure_keystores(config, &keystorelist);
if (result != ISC_R_SUCCESS) {
goto cleanup_keystorelist;
}
result = configure_kasplist(config, &kasplist, &keystorelist);
if (result != ISC_R_SUCCESS) {
goto cleanup_kasplist;
}
result = create_views(config, configparser, aclconfctx, &viewlist);
if (result != ISC_R_SUCCESS) {
goto cleanup_viewlist;
}
result = configure_views(config, bindkeys, aclconfctx, &viewlist,
&cachelist, &kasplist, server, first_time);
if (result != ISC_R_SUCCESS) {
@ -9258,6 +9258,22 @@ cleanup_cachelist:
isc_mem_put(server->mctx, nsc, sizeof(*nsc));
}
cleanup_portsets:
isc_portset_destroy(isc_g_mctx, &v6portset);
isc_portset_destroy(isc_g_mctx, &v4portset);
cleanup_bindkeys_parser:
if (bindkeys_parser != NULL) {
if (bindkeys != NULL) {
cfg_obj_destroy(bindkeys_parser, &bindkeys);
}
cfg_parser_destroy(&bindkeys_parser);
}
if (exclusive) {
isc_loopmgr_resume();
}
cleanup_viewlist:
ISC_LIST_FOREACH(viewlist, view, link) {
ISC_LIST_UNLINK(viewlist, view, link);
@ -9281,22 +9297,6 @@ cleanup_keystorelist:
dns_keystore_detach(&keystore);
}
cleanup_portsets:
isc_portset_destroy(isc_g_mctx, &v6portset);
isc_portset_destroy(isc_g_mctx, &v4portset);
cleanup_bindkeys_parser:
if (bindkeys_parser != NULL) {
if (bindkeys != NULL) {
cfg_obj_destroy(bindkeys_parser, &bindkeys);
}
cfg_parser_destroy(&bindkeys_parser);
}
if (exclusive) {
isc_loopmgr_resume();
}
cleanup_aclconfctx:
if (aclconfctx != NULL) {
cfg_aclconfctx_detach(&aclconfctx);