This is an automated email from the ASF dual-hosted git repository.
jianliangqi pushed a commit to branch clucene-2.0
in repository https://gitbox.apache.org/repos/asf/doris-thirdparty.git
The following commit(s) were added to refs/heads/clucene-2.0 by this push:
new 692fdf7aaf [Pick 2.0](index writer) fix docWriter is null, when
reenter close (#217)
692fdf7aaf is described below
commit 692fdf7aaf5d0ae6706ece7a036c9d921b46cd51
Author: airborne12 <[email protected]>
AuthorDate: Wed May 22 11:58:45 2024 +0800
[Pick 2.0](index writer) fix docWriter is null, when reenter close (#217)
* [Fix](index writer) fix core if docWriter nullptr when IndexWriter
doFlush (#213)
* [Fix](index writer) fix docWriter is null, when reenter close (#214)
---
src/core/CLucene/index/IndexWriter.cpp | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/core/CLucene/index/IndexWriter.cpp
b/src/core/CLucene/index/IndexWriter.cpp
index e6a0887557..8bc3a93455 100644
--- a/src/core/CLucene/index/IndexWriter.cpp
+++ b/src/core/CLucene/index/IndexWriter.cpp
@@ -535,7 +535,10 @@ void IndexWriter::closeInternal(bool waitForMerges) {
try {
if (infoStream != NULL)
message(string("now flush at close"));
-
+ // if docWriter is nullptr, maybe it's been flushed already
+ if (docWriter == nullptr) {
+ return;
+ }
docWriter->close();
// Only allow a _CLNEW merge to be triggered if we are
@@ -2048,6 +2051,11 @@ void IndexWriter::flush(bool triggerMerge, bool
_flushDocStores) {
bool IndexWriter::doFlush(bool _flushDocStores) {
SCOPED_LOCK_MUTEX(THIS_LOCK)
+ // if docWriter is nullptr, maybe it's been flushed already
+ if (docWriter == nullptr) {
+ return false;
+ }
+
// Make sure no threads are actively adding a document
// Returns true if docWriter is currently aborting, in
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]