mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
[master] add zone memory context pools
3492. [bug] Fixed a regression in zone loading performance due to lock contention. [RT #30399]
This commit is contained in:
@@ -110,6 +110,46 @@ ATF_TC_BODY(zonemgr_managezone, tc) {
|
||||
dns_test_end();
|
||||
}
|
||||
|
||||
ATF_TC(zonemgr_createzone);
|
||||
ATF_TC_HEAD(zonemgr_createzone, tc) {
|
||||
atf_tc_set_md_var(tc, "descr", "create and release a zone");
|
||||
}
|
||||
ATF_TC_BODY(zonemgr_createzone, tc) {
|
||||
dns_zonemgr_t *zonemgr = NULL;
|
||||
dns_zone_t *zone = NULL;
|
||||
isc_result_t result;
|
||||
|
||||
UNUSED(tc);
|
||||
|
||||
result = dns_test_begin(NULL, ISC_TRUE);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
result = dns_zonemgr_create(mctx, taskmgr, timermgr, socketmgr,
|
||||
&zonemgr);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
/* This should not succeed until the dns_zonemgr_setsize() is run */
|
||||
result = dns_zonemgr_createzone(zonemgr, &zone);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_FAILURE);
|
||||
|
||||
result = dns_zonemgr_setsize(zonemgr, 1);
|
||||
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
|
||||
|
||||
/* Now it should succeed */
|
||||
result = dns_zonemgr_createzone(zonemgr, &zone);
|
||||
ATF_CHECK_EQ(result, ISC_R_SUCCESS);
|
||||
ATF_CHECK(zone != NULL);
|
||||
|
||||
if (zone != NULL)
|
||||
dns_zone_detach(&zone);
|
||||
|
||||
dns_zonemgr_shutdown(zonemgr);
|
||||
dns_zonemgr_detach(&zonemgr);
|
||||
ATF_REQUIRE_EQ(zonemgr, NULL);
|
||||
|
||||
dns_test_end();
|
||||
}
|
||||
|
||||
ATF_TC(zonemgr_unreachable);
|
||||
ATF_TC_HEAD(zonemgr_unreachable, tc) {
|
||||
atf_tc_set_md_var(tc, "descr", "manage and release a zone");
|
||||
@@ -182,6 +222,7 @@ ATF_TC_BODY(zonemgr_unreachable, tc) {
|
||||
ATF_TP_ADD_TCS(tp) {
|
||||
ATF_TP_ADD_TC(tp, zonemgr_create);
|
||||
ATF_TP_ADD_TC(tp, zonemgr_managezone);
|
||||
ATF_TP_ADD_TC(tp, zonemgr_createzone);
|
||||
ATF_TP_ADD_TC(tp, zonemgr_unreachable);
|
||||
return (atf_no_error());
|
||||
}
|
||||
|
Reference in New Issue
Block a user