You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2021/04/15 17:09:52 UTC

[GitHub] [solr] asalamon74 commented on a change in pull request #67: SOLR-15329 Improve hdfs directory size calculation

asalamon74 commented on a change in pull request #67:
URL: https://github.com/apache/solr/pull/67#discussion_r614249826



##########
File path: solr/core/src/java/org/apache/solr/core/HdfsDirectoryFactory.java
##########
@@ -452,8 +452,6 @@ public long size(String path) throws IOException {
     } catch (IOException e) {
       log.error("Error checking if hdfs path exists", e);
       throw new SolrException(ErrorCode.SERVER_ERROR, "Error checking if hdfs path exists", e);
-    } finally {
-      IOUtils.closeQuietly(fileSystem);

Review comment:
       Without removing this I got filesystem already closed exceptions.
   
   We are getting the fileSystem using `FileSystem fileSystem = getCachedFileSystem(path)`. And cache will take care of the close as stated here: https://github.com/apache/solr/blob/main/solr/core/src/java/org/apache/solr/core/HdfsDirectoryFactory.java#L462
   
   ```
   // no need to close the fs, the cache will do it
   ```




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org