github-actions[bot] commented on code in PR #70262: URL: https://github.com/apache/doris/pull/70262#discussion_r4502207476
########## be/test/testutil/tmp_file_dirs_util.cpp: ########## @@ -0,0 +1,48 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "testutil/tmp_file_dirs_util.h" + +#include <memory> +#include <string> +#include <vector> + +#include "common/check.h" +#include "common/status.h" +#include "io/fs/local_file_system.h" +#include "runtime/exec_env.h" +#include "storage/index/index_writer.h" +#include "storage/options.h" + +namespace doris::test { + +void ensure_tmp_file_dirs() { + if (ExecEnv::GetInstance()->get_tmp_file_dirs() != nullptr) { Review Comment: [P2] Recreate stale test temp directories before returning. ensure_tmp_file_dirs() treats any non-null ExecEnv pointer as usable, but other BE fixtures install their own TmpFileDirs and delete that directory in TearDown without clearing ExecEnv. A later AnalysisWriteGolden/LuceneBridgeWriter test can therefore inherit a non-null object whose get_tmp_file_dir() no longer exists, causing IndexFileWriter temp-file setup to fail based on test order. Validate the configured path or replace stale test state before returning. ########## be/src/storage/index/inverted/clucene/inverted_index_writer.cpp: ########## @@ -21,6 +21,7 @@ #include "storage/index/index_file_writer.h" #include "storage/index/index_fs_directory.h" #include "storage/index/inverted/analysis/analyzer/analyzer.h" +#include "storage/index/inverted/clucene/lucene_analyzer_bridge.h" #include "storage/key_coder.h" Review Comment: [P2] Release the bridge batch on V1/V2 analyzer failure. This change routes the writer through LuceneAnalyzerBridge, whose LuceneTokenStreamBridge keeps a TokenBatch arena after each successful batch and only calls release_oversized() when the stream reaches normal exhaustion; reset() only clears it and close() is empty. If a TextTokenStream throws after handing over a large partial batch, add_document() calls close_on_error(), which closes the IndexWriter but leaves _analyzer and its bridge alive until the failed writer is destroyed, retaining that memory during IndexBuilder unwind. Make the bridge cleanup discard the batch (and its stream state) on close/error, or release the analyzer bridge from the writer's error path. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
