Reamer commented on a change in pull request #4109:
URL: https://github.com/apache/zeppelin/pull/4109#discussion_r627115611



##########
File path: 
zeppelin-zengine/src/main/java/org/apache/zeppelin/search/LuceneSearch.java
##########
@@ -371,6 +372,7 @@ private void deleteDoc(String noteId, Paragraph p) {
    * @see org.apache.zeppelin.search.Search#close()
    */
   @Override
+  @PreDestroy
   public void close() {
     try {
       indexWriter.close();

Review comment:
       > First, it is necessary to check whether `LuceneSearch` instance is 
created using the Java EE container(dependency injection) in the test you 
mentioned.
   
   LuceneSearch is started by Jetty - 
[Link](https://github.com/apache/zeppelin/blob/91bfbf9db1b2ca915644c264694e0add03a69e61/zeppelin-server/src/main/java/org/apache/zeppelin/server/ZeppelinServer.java#L219)
   During Zeppelin Server tests, e.g. in 
[NotebookRestApiTest](https://github.com/apache/zeppelin/blob/master/zeppelin-server/src/test/java/org/apache/zeppelin/rest/NotebookRestApiTest.java),
 the server is restarted several times.
   You can search for the Stacktraces (keyword `LockObtainFailedException`) in 
the [last 
CI](https://pipelines.actions.githubusercontent.com/Y581u358DfamG5WExglSJr5GUw71gpY3tFyZWVl6aGaGrt8Y5v/_apis/pipelines/1/runs/1914/signedlogcontent/12?urlExpires=2021-05-06T06%3A22%3A05.5237793Z&urlSigningMethod=HMACV1&urlSignature=hA3ohf2B2%2FYMqxBz3E4eEf8Xgf6QTy75HAaZrmCqouU%3D)
 run.
   
   You are right, we should also close LuceneSearch in `NotebookSearviceTest`.
   
   




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to