Skip to content

Commit

Permalink
[Pick 2.0](index writer) fix dead lock when closeInternal catches CLu…
Browse files Browse the repository at this point in the history
…ceneError (#207) (#212)

This pull request addresses an issue within the closeInternal method. 
When Thread A invokes closeInternal and encounters a CLucene error, the method exits without setting the closing flag back to false. 
As a result, if another Thread B subsequently calls closeInternal and enters the waitForClose method, it becomes trapped in an infinite loop.
  • Loading branch information
airborne12 authored May 9, 2024
1 parent f10bc3f commit f40d429
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/core/CLucene/index/IndexWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,6 @@ void IndexWriter::closeInternal(bool waitForMerges) {
} catch (std::bad_alloc &) {
hitOOM = true;
_CLTHROWA(CL_ERR_OutOfMemory, "Out of memory");
} catch (CLuceneError &e) {
throw e;
}
_CLFINALLY(
{
Expand Down

0 comments on commit f40d429

Please sign in to comment.