]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[v9_11] Do not use thread-local storage for storing LMDB reader locktable slots
authorMichał Kępień <michal@isc.org>
Mon, 27 Nov 2017 08:48:10 +0000 (09:48 +0100)
committerMichał Kępień <michal@isc.org>
Mon, 27 Nov 2017 08:48:49 +0000 (09:48 +0100)
4828. [bug] Do not use thread-local storage for storing LMDB reader
locktable slots. [RT #46556]

(cherry picked from commit 40a90fbf89738c1aa867a5f09ef7243ef3ae52e4)

CHANGES
bin/named/server.c
lib/dns/view.c

diff --git a/CHANGES b/CHANGES
index d8e793c3c2bbe309bb8b999f63c28bdb44afda64..169243258e6d1fb98b2c8a7ff55f08441136eb80 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+4828.  [bug]           Do not use thread-local storage for storing LMDB reader
+                       locktable slots. [RT #46556]
+
 4827.  [misc]          Add a precommit check script util/checklibs.sh
                        [RT #46215]
 
index 03c1b1989b82f6ef15a7e8034a02ca11c690fda2..9098084e845914a5b2add185855adf7d20d2750a 100644 (file)
@@ -11486,8 +11486,13 @@ nzd_env_reopen(dns_view_t *view) {
                }
        }
 
+       /*
+        * MDB_NOTLS is used to prevent problems after configuration is
+        * reloaded, due to the way LMDB's use of thread-local storage (TLS)
+        * interacts with the BIND9 thread model.
+        */
        status = mdb_env_open(env, view->new_zone_db,
-                             MDB_NOSUBDIR|MDB_CREATE, 0600);
+                             MDB_NOSUBDIR|MDB_NOTLS|MDB_CREATE, 0600);
        if (status != 0) {
                isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL,
                              ISC_LOGMODULE_OTHER, ISC_LOG_ERROR,
index 82597ad9636c7b7c30025aa0e98a6c0199d6ffd1..2558a6d431a6cb86c4b9ab5aeb7d265a35bee607 100644 (file)
@@ -2066,8 +2066,13 @@ dns_view_setnewzones(dns_view_t *view, isc_boolean_t allow, void *cfgctx,
                }
        }
 
+       /*
+        * MDB_NOTLS is used to prevent problems after configuration is
+        * reloaded, due to the way LMDB's use of thread-local storage (TLS)
+        * interacts with the BIND9 thread model.
+        */
        status = mdb_env_open(env, view->new_zone_db,
-                             MDB_NOSUBDIR|MDB_CREATE, 0600);
+                             MDB_NOSUBDIR|MDB_NOTLS|MDB_CREATE, 0600);
        if (status != 0) {
                isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL,
                              ISC_LOGMODULE_OTHER, ISC_LOG_ERROR,