This is an automated email from the ASF dual-hosted git repository.
jianliangqi pushed a commit to branch clucene
in repository https://gitbox.apache.org/repos/asf/doris-thirdparty.git
The following commit(s) were added to refs/heads/clucene by this push:
new 9e1fd04733 [Fix](index writer) fix core if docWriter nullptr when
IndexWriter doFlush (#213)
9e1fd04733 is described below
commit 9e1fd04733efc8f5e91acdf29f2a7cb2ec4bd973
Author: airborne12 <[email protected]>
AuthorDate: Fri May 10 20:03:16 2024 +0800
[Fix](index writer) fix core if docWriter nullptr when IndexWriter doFlush
(#213)
---
src/core/CLucene/index/IndexWriter.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/core/CLucene/index/IndexWriter.cpp
b/src/core/CLucene/index/IndexWriter.cpp
index e6a0887557..e2e6ae7d73 100644
--- a/src/core/CLucene/index/IndexWriter.cpp
+++ b/src/core/CLucene/index/IndexWriter.cpp
@@ -2048,6 +2048,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]