Skip to content

Commit f8d7d51

Browse files
committed
split index hash clear from removing
On shutdown some workers sometimes still need access to index hash, so full removing of the hash is not appropriate. However nobody forbids to clear the hashes, and then delete them when all workers stopped That is related and should fix #2433
1 parent 93b5067 commit f8d7d51

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/searchd.cpp

+10-4
Original file line numberDiff line numberDiff line change
@@ -758,12 +758,12 @@ void Shutdown () REQUIRES ( MainThread ) NO_THREAD_SAFETY_ANALYSIS
758758
}
759759

760760
Threads::CallCoroutine ( [] {
761-
SHUTINFO << "Remove local indexes list ...";
762-
SafeDelete ( g_pLocalIndexes );
761+
SHUTINFO << "Abandon local indexes list ...";
762+
g_pLocalIndexes->ReleaseAndClear();
763763

764764
// unlock Distr indexes automatically done by d-tr
765-
SHUTINFO << "Remove distr indexes list ...";
766-
SafeDelete ( g_pDistIndexes );
765+
SHUTINFO << "Abandon distr indexes list ...";
766+
g_pDistIndexes->ReleaseAndClear();
767767
} );
768768

769769
SHUTINFO << "Shutdown alone threads (if any) ...";
@@ -774,6 +774,12 @@ void Shutdown () REQUIRES ( MainThread ) NO_THREAD_SAFETY_ANALYSIS
774774
if ( pPool )
775775
pPool->StopAll();
776776

777+
SHUTINFO << "Remove local indexes list ...";
778+
SafeDelete ( g_pLocalIndexes );
779+
780+
SHUTINFO << "Remove distr indexes list ...";
781+
SafeDelete ( g_pDistIndexes );
782+
777783
// clear shut down of rt indexes + binlog
778784
SHUTINFO << "Finish IO stats collecting ...";
779785
sphDoneIOStats();

0 commit comments

Comments
 (0)