github-actions[bot] commented on code in PR #29676:
URL: https://github.com/apache/doris/pull/29676#discussion_r1444315149


##########
be/src/olap/rowset/segment_v2/inverted_index_cache.cpp:
##########
@@ -44,13 +44,19 @@ namespace doris::segment_v2 {
 
 Status FulltextIndexSearcherBuilder::build(DorisCompoundReader* directory,
                                            OptionalIndexSearcherPtr& 
output_searcher) {
-    auto closeDirectory = true;
-    auto* reader = lucene::index::IndexReader::open(
-            directory, config::inverted_index_read_buffer_size, 
closeDirectory);
+    auto close_directory = true;
+    lucene::index::IndexReader* reader = nullptr;
+    try {
+        reader = lucene::index::IndexReader::open(
+                directory, config::inverted_index_read_buffer_size, 
close_directory);
+    } catch (const CLuceneError& e) {
+        if (reader) reader->close();

Review Comment:
   warning: statement should be inside braces 
[readability-braces-around-statements]
   
   ```suggestion
           if (reader) { reader->close();
   }
   ```
   



-- 
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]

Reply via email to