From: Daniel Salzman Date: Thu, 7 Apr 2022 13:02:01 +0000 (+0200) Subject: conf: call mdb_reader_check() if confdb opening fails X-Git-Tag: v3.3.dev~151^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f404602bbfe5211811c022ebc66a4bbdb4bc1de9;p=thirdparty%2Fknot-dns.git conf: call mdb_reader_check() if confdb opening fails --- diff --git a/src/libknot/db/db_lmdb.c b/src/libknot/db/db_lmdb.c index 9341f5dd9e..b5eae0944a 100644 --- a/src/libknot/db/db_lmdb.c +++ b/src/libknot/db/db_lmdb.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 CZ.NIC, z.s.p.o. +/* Copyright (C) 2022 CZ.NIC, z.s.p.o. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -181,6 +181,13 @@ static int dbase_open(struct lmdb_env *env, struct knot_db_lmdb_opts *opts) /* Open the database. */ MDB_txn *txn = NULL; int ret = mdb_txn_begin(env->env, NULL, flags, &txn); + if (ret == MDB_READERS_FULL) { + int cleared = 0; + ret = mdb_reader_check(env->env, &cleared); + if (ret == MDB_SUCCESS) { + ret = mdb_txn_begin(env->env, NULL, flags, &txn); + } + } if (ret != MDB_SUCCESS) { mdb_env_close(env->env); return lmdb_error_to_knot(ret);