Slightly experimental change to speed up indexer exit after interrupt by closing up all queues.

This commit is contained in:
Jean-Francois Dockes
2021-11-24 19:46:56 +01:00
parent 5f2716e628
commit 02c9a6f3f7
5 changed files with 59 additions and 38 deletions
+8 -2
View File
@@ -1028,11 +1028,11 @@ bool Db::i_close(bool final)
bool w = m_ndb->m_iswritable;
if (w) {
#ifdef IDX_THREADS
m_ndb->m_wqueue.closeShop();
waitUpdIdle();
#endif
if (!m_ndb->m_noversionwrite)
m_ndb->xwdb.set_metadata(cstr_RCL_IDX_VERSION_KEY,
cstr_RCL_IDX_VERSION);
m_ndb->xwdb.set_metadata(cstr_RCL_IDX_VERSION_KEY, cstr_RCL_IDX_VERSION);
LOGDEB("Rcl::Db:close: xapian will close. May take some time\n");
}
deleteZ(m_ndb);
@@ -1974,6 +1974,12 @@ bool Db::Native::docToXdocXattrOnly(TextSplitDb *splitter, const string &udi,
}
#ifdef IDX_THREADS
void Db::closeQueue()
{
if (m_ndb->m_iswritable && m_ndb->m_havewriteq) {
m_ndb->m_wqueue.closeShop();
}
}
void Db::waitUpdIdle()
{
if (m_ndb->m_iswritable && m_ndb->m_havewriteq) {
+1
View File
@@ -335,6 +335,7 @@ public:
bool addOrUpdate(const string &udi, const string &parent_udi, Doc &doc);
#ifdef IDX_THREADS
void closeQueue();
void waitUpdIdle();
#endif