Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-10778 Address precommit WARNINGS
  3. SOLR-14266

Fix or suppress 14 resource leak warnings in apache/solr/core

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Patch Available
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      There are 14 resource leak warnings inĀ apache/solr/common:

      [ecj-lint] 10. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/solr/core/src/java/org/apache/solr/core/CoreContainer.java (at line 745)
       [ecj-lint]     SolrFieldCacheBean fieldCacheBean = new SolrFieldCacheBean();
       [ecj-lint]                        ^^^^^^^^^^^^^^
       [ecj-lint] Resource leak: 'fieldCacheBean' is never closed
      --
       [ecj-lint] 5. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/solr/core/src/test/org/apache/solr/core/ResourceLoaderTest.java (at line 215)
       [ecj-lint]     SolrResourceLoader loader = new SolrResourceLoader();
       [ecj-lint]                        ^^^^^^
       [ecj-lint] Resource leak: 'loader' is never closed
      --
       [ecj-lint] 6. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/solr/core/src/test/org/apache/solr/core/TestLazyCores.java (at line 244)
       [ecj-lint]     MetricsHandler handler = new MetricsHandler(h.getCoreContainer());
       [ecj-lint]                    ^^^^^^^
       [ecj-lint] Resource leak: 'handler' is never closed
      --
       [ecj-lint] 7. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/solr/core/src/test/org/apache/solr/core/TestLazyCores.java (at line 364)
       [ecj-lint]     final CoreAdminHandler admin = new CoreAdminHandler(cc);
       [ecj-lint]                            ^^^^^
       [ecj-lint] Resource leak: 'admin' is never closed
      --
       [ecj-lint] 8. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/solr/core/src/test/org/apache/solr/core/TestLazyCores.java (at line 378)
       [ecj-lint]     final CoreAdminHandler admin = new CoreAdminHandler(cc);
       [ecj-lint]                            ^^^^^
       [ecj-lint] Resource leak: 'admin' is never closed
      --
       [ecj-lint] 9. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/solr/core/src/test/org/apache/solr/core/TestLazyCores.java (at line 638)
       [ecj-lint]     final CoreAdminHandler admin = new CoreAdminHandler(cc);
       [ecj-lint]                            ^^^^^
       [ecj-lint] Resource leak: 'admin' is never closed
      --
       [ecj-lint] 10. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/solr/core/src/test/org/apache/solr/core/backup/repository/HdfsBackupRepositoryTest.java (at line 32)
       [ecj-lint]     HdfsBackupRepository hdfsBackupRepository = new HdfsBackupRepository();
       [ecj-lint]                          ^^^^^^^^^^^^^^^^^^^^
       [ecj-lint] Resource leak: 'hdfsBackupRepository' is never closed
      --
       [ecj-lint] 11. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/solr/core/src/test/org/apache/solr/core/backup/repository/HdfsBackupRepositoryTest.java (at line 39)
       [ecj-lint]     HdfsBackupRepository hdfsBackupRepository = new HdfsBackupRepository();
       [ecj-lint]                          ^^^^^^^^^^^^^^^^^^^^
       [ecj-lint] Resource leak: 'hdfsBackupRepository' is never closed
      --
       [ecj-lint] 12. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/solr/core/src/test/org/apache/solr/core/backup/repository/HdfsBackupRepositoryTest.java (at line 47)
       [ecj-lint]     HdfsBackupRepository hdfsBackupRepository = new HdfsBackupRepository();
       [ecj-lint]                          ^^^^^^^^^^^^^^^^^^^^
       [ecj-lint] Resource leak: 'hdfsBackupRepository' is never closed
      --
       [ecj-lint] 13. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/solr/core/src/test/org/apache/solr/core/backup/repository/HdfsBackupRepositoryTest.java (at line 55)
       [ecj-lint]     HdfsBackupRepository hdfsBackupRepository = new HdfsBackupRepository();
       [ecj-lint]                          ^^^^^^^^^^^^^^^^^^^^
       [ecj-lint] Resource leak: 'hdfsBackupRepository' is never closed
      --
       [ecj-lint] 14. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/solr/core/src/test/org/apache/solr/core/backup/repository/HdfsBackupRepositoryTest.java (at line 63)
       [ecj-lint]     HdfsBackupRepository hdfsBackupRepository = new HdfsBackupRepository();
       [ecj-lint]                          ^^^^^^^^^^^^^^^^^^^^
       [ecj-lint] Resource leak: 'hdfsBackupRepository' is never closed
      --
       [ecj-lint] 15. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/solr/core/src/test/org/apache/solr/core/backup/repository/HdfsBackupRepositoryTest.java (at line 71)
       [ecj-lint]     HdfsBackupRepository hdfsBackupRepository = new HdfsBackupRepository();
       [ecj-lint]                          ^^^^^^^^^^^^^^^^^^^^
       [ecj-lint] Resource leak: 'hdfsBackupRepository' is never closed
      --
       [ecj-lint] 16. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/solr/core/src/test/org/apache/solr/core/backup/repository/HdfsBackupRepositoryTest.java (at line 79)
       [ecj-lint]     HdfsBackupRepository hdfsBackupRepository = new HdfsBackupRepository();
       [ecj-lint]                          ^^^^^^^^^^^^^^^^^^^^
       [ecj-lint] Resource leak: 'hdfsBackupRepository' is never closed
      --
       [ecj-lint] 17. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/solr/core/src/test/org/apache/solr/core/backup/repository/HdfsBackupRepositoryTest.java (at line 89)
       [ecj-lint]     HdfsBackupRepository hdfsBackupRepository = new HdfsBackupRepository();
       [ecj-lint]                          ^^^^^^^^^^^^^^^^^^^^
       [ecj-lint] Resource leak: 'hdfsBackupRepository' is never closed
      

        Attachments

        1. SOLR-14266-01.patch
          12 kB
          Andras Salamon

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              asalamon74 Andras Salamon
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: