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

Fix or suppress 11 resource leak warnings in apache/solr/cloud

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 8.6
    • None
    • None

    Description

      There are 11 warnings in apache/solr/cloud:

       [ecj-lint] 2. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java (at line 644)
       [ecj-lint] 	PeerSyncWithLeader peerSyncWithLeader = new PeerSyncWithLeader(core,
       [ecj-lint] 	                   ^^^^^^^^^^^^^^^^^^
       [ecj-lint] Resource leak: 'peerSyncWithLeader' is never closed
      --
       [ecj-lint] 3. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/solr/core/src/java/org/apache/solr/cloud/SyncStrategy.java (at line 182)
       [ecj-lint] 	PeerSync peerSync = new PeerSync(core, syncWith, core.getUpdateHandler().getUpdateLog().getNumRecordsToKeep(), true, peerSyncOnlyWithActive, false);
       [ecj-lint] 	         ^^^^^^^^
       [ecj-lint] Resource leak: 'peerSync' is never closed
      --
       [ecj-lint] 4. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/solr/core/src/java/org/apache/solr/cloud/autoscaling/sim/SimCloudManager.java (at line 793)
       [ecj-lint] 	throw new UnsupportedOperationException("must add at least 1 node first");
       [ecj-lint] 	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       [ecj-lint] Resource leak: 'queryRequest' is not closed at this location
      --
       [ecj-lint] 5. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/solr/core/src/java/org/apache/solr/cloud/autoscaling/sim/SimCloudManager.java (at line 799)
       [ecj-lint] 	throw new UnsupportedOperationException("must add at least 1 node first");
       [ecj-lint] 	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       [ecj-lint] Resource leak: 'queryRequest' is not closed at this location
      --
       [ecj-lint] 6. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/solr/core/src/java/org/apache/solr/cloud/autoscaling/sim/SimScenario.java (at line 408)
       [ecj-lint] 	SnapshotCloudManager snapshotCloudManager = new SnapshotCloudManager(scenario.cluster, null);
       [ecj-lint] 	                     ^^^^^^^^^^^^^^^^^^^^
       [ecj-lint] Resource leak: 'snapshotCloudManager' is never closed
      --
       [ecj-lint] 7. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/solr/core/src/java/org/apache/solr/cloud/autoscaling/sim/SimScenario.java (at line 743)
       [ecj-lint] 	throw new IOException("currently only one listener can be set per trigger. Trigger name: " + trigger);
       [ecj-lint] 	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       [ecj-lint] Resource leak: 'listener' is not closed at this location
      --
       [ecj-lint] 8. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/solr/core/src/java/org/apache/solr/cloud/autoscaling/sim/SimScenario.java (at line 952)
       [ecj-lint] 	SnapshotCloudManager snapshotCloudManager = new SnapshotCloudManager(scenario.cluster, null);
       [ecj-lint] 	                     ^^^^^^^^^^^^^^^^^^^^
       [ecj-lint] Resource leak: 'snapshotCloudManager' is never closed
      --
       [ecj-lint] 9. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/solr/core/src/java/org/apache/solr/cloud/autoscaling/sim/SimScenario.java (at line 991)
       [ecj-lint] 	SimScenario scenario = new SimScenario();
       [ecj-lint] 	            ^^^^^^^^
       [ecj-lint] Resource leak: 'scenario' is never closed
      --
       [ecj-lint] 1. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyShardSplitTest.java (at line 264)
       [ecj-lint] 	Overseer overseer = new Overseer((HttpShardHandler) new HttpShardHandlerFactory().getShardHandler(), updateShardHandler, "/admin/cores",
       [ecj-lint] 	                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       [ecj-lint] Resource leak: '<unassigned Closeable value>' is never closed
      --
       [ecj-lint] 2. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/solr/core/src/test/org/apache/solr/cloud/ZkNodePropsTest.java (at line 48)
       [ecj-lint] 	new JavaBinCodec().marshal(zkProps.getProperties(), baos);
       [ecj-lint] 	^^^^^^^^^^^^^^^^^^
       [ecj-lint] Resource leak: '<unassigned Closeable value>' is never closed
      --
       [ecj-lint] 3. WARNING in /Users/andrassalamon/src/lucene-solr-upstream/solr/core/src/test/org/apache/solr/cloud/autoscaling/sim/TestSnapshotCloudManager.java (at line 124)
       [ecj-lint] 	SnapshotCloudManager snapshotCloudManager = new SnapshotCloudManager(realManager, null);
       [ecj-lint] 	                     ^^^^^^^^^^^^^^^^^^^^
       [ecj-lint] Resource leak: 'snapshotCloudManager' is never closed
      
       

      Attachments

        1. SOLR-14485-01.patch
          11 kB
          Erick Erickson
        2. SOLR-14485-01.patch
          10 kB
          Andras Salamon
        3. SOLR-14485-01.patch
          10 kB
          Andras Salamon

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            erickerickson Erick Erickson
            asalamon74 Andras Salamon
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment