Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-8908

Registering each ZkIndexSchemaReader as an OnReconnect listener introduces a memory leak

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.0, 5.1, 5.2, 5.2.1, 5.3, 5.3.1, 5.4, 5.4.1, 5.5
    • Fix Version/s: 5.5.1, 6.0.1, 6.1
    • Component/s: Schema and Analysis
    • Labels:
    • Flags:
      Important

      Description

      As discovered by Alexey Serba, each ZkIndexSchemaReader registers as an OnReconnect listener with the ZkController to get notified when the ZK Session has been re-established. However, the ZkIndexSchemaReader is never removed from the reconnectListeners list in ZkController when the core is reloaded or removed.

      Moreover, it also means that the same core is re-notified of the re-connect more than once if it has been reloaded.

      This leads to a memory leak, which can become a real issue if you have a lot of cores or do a lot of reloads of your cores.

        Activity

        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit d6167deee28fbc459f6a7e33e70be11dd8afdf2d in lucene-solr's branch refs/heads/jira/SOLR-8908 from Timothy Potter
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=d6167de ]

        SOLR-8908: Solution sans test

        Show
        jira-bot ASF subversion and git services added a comment - Commit d6167deee28fbc459f6a7e33e70be11dd8afdf2d in lucene-solr's branch refs/heads/jira/ SOLR-8908 from Timothy Potter [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=d6167de ] SOLR-8908 : Solution sans test
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 146f00c1ad9984ca5d12f8b9925642933e39dade in lucene-solr's branch refs/heads/jira/SOLR-8908 from Timothy Potter
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=146f00c ]

        Merge branch 'master' into jira/SOLR-8908

        Show
        jira-bot ASF subversion and git services added a comment - Commit 146f00c1ad9984ca5d12f8b9925642933e39dade in lucene-solr's branch refs/heads/jira/ SOLR-8908 from Timothy Potter [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=146f00c ] Merge branch 'master' into jira/ SOLR-8908
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit c948a9058336b20e7eac60669683661bcdf49161 in lucene-solr's branch refs/heads/jira/SOLR-8908 from Timothy Potter
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=c948a90 ]

        Merge branch 'master' into jira/SOLR-8908

        Show
        jira-bot ASF subversion and git services added a comment - Commit c948a9058336b20e7eac60669683661bcdf49161 in lucene-solr's branch refs/heads/jira/ SOLR-8908 from Timothy Potter [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=c948a90 ] Merge branch 'master' into jira/ SOLR-8908
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 18eb7f4c47a5f10ea878b8ca367c77a61b0f540c in lucene-solr's branch refs/heads/jira/SOLR-8908 from Timothy Potter
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=18eb7f4 ]

        Merge branch 'master' into jira/SOLR-8908

        Show
        jira-bot ASF subversion and git services added a comment - Commit 18eb7f4c47a5f10ea878b8ca367c77a61b0f540c in lucene-solr's branch refs/heads/jira/ SOLR-8908 from Timothy Potter [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=18eb7f4 ] Merge branch 'master' into jira/ SOLR-8908
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 4db9f6bfeaad38f66877ebd6e6b5a58683644842 in lucene-solr's branch refs/heads/jira/SOLR-8908 from Timothy Potter
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=4db9f6b ]

        Update CHANGES.txt to mention fix for SOLR-8908

        Show
        jira-bot ASF subversion and git services added a comment - Commit 4db9f6bfeaad38f66877ebd6e6b5a58683644842 in lucene-solr's branch refs/heads/jira/ SOLR-8908 from Timothy Potter [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=4db9f6b ] Update CHANGES.txt to mention fix for SOLR-8908
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit b36a6ecbe44d9b458fe79198616a4bed19d4c08b in lucene-solr's branch refs/heads/master from Timothy Potter
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=b36a6ec ]

        SOLR-8908: Fixed OnReconnect listener management in ZkController to allow for de-registering listeners.

        Here's what this commit includes:

        • Added the removeOnReconnectListener method to ZkController to allow OnReconnect listener implementations to de-register; avoids a memory leak
        • Updated ZkIndexSchemaReader to add a CloseHook to the SolrCore it supports to de-register as an OnReconnect listener
        • Added unit test to verify that after reloading and deleting a SolrCore in managed schema mode, the associated ZkIndexSchemaReader gets de-registered correctly
        Show
        jira-bot ASF subversion and git services added a comment - Commit b36a6ecbe44d9b458fe79198616a4bed19d4c08b in lucene-solr's branch refs/heads/master from Timothy Potter [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=b36a6ec ] SOLR-8908 : Fixed OnReconnect listener management in ZkController to allow for de-registering listeners. Here's what this commit includes: Added the removeOnReconnectListener method to ZkController to allow OnReconnect listener implementations to de-register; avoids a memory leak Updated ZkIndexSchemaReader to add a CloseHook to the SolrCore it supports to de-register as an OnReconnect listener Added unit test to verify that after reloading and deleting a SolrCore in managed schema mode, the associated ZkIndexSchemaReader gets de-registered correctly
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit af8a9624178e5e62b652ce3799c6e705056a3ae8 in lucene-solr's branch refs/heads/branch_6x from Timothy Potter
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=af8a962 ]

        SOLR-8908: Fixed OnReconnect listener management in ZkController to allow for de-registering listeners.

        Here's what this commit includes:

        • Added the removeOnReconnectListener method to ZkController to allow OnReconnect listener implementations to de-register; avoids a memory leak
        • Updated ZkIndexSchemaReader to add a CloseHook to the SolrCore it supports to de-register as an OnReconnect listener
        • Added unit test to verify that after reloading and deleting a SolrCore in managed schema mode, the associated ZkIndexSchemaReader gets de-registered correctly
        Show
        jira-bot ASF subversion and git services added a comment - Commit af8a9624178e5e62b652ce3799c6e705056a3ae8 in lucene-solr's branch refs/heads/branch_6x from Timothy Potter [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=af8a962 ] SOLR-8908 : Fixed OnReconnect listener management in ZkController to allow for de-registering listeners. Here's what this commit includes: Added the removeOnReconnectListener method to ZkController to allow OnReconnect listener implementations to de-register; avoids a memory leak Updated ZkIndexSchemaReader to add a CloseHook to the SolrCore it supports to de-register as an OnReconnect listener Added unit test to verify that after reloading and deleting a SolrCore in managed schema mode, the associated ZkIndexSchemaReader gets de-registered correctly
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 34b99fdb1301b48a5e07f0678924fe5bf9033c12 in lucene-solr's branch refs/heads/branch_5x from Timothy Potter
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=34b99fd ]

        SOLR-8908: Fixed OnReconnect listener management in ZkController to allow for de-registering listeners.

        Here's what this commit includes:

        • Added the removeOnReconnectListener method to ZkController to allow OnReconnect listener implementations to de-register; avoids a memory leak
        • Updated ZkIndexSchemaReader to add a CloseHook to the SolrCore it supports to de-register as an OnReconnect listener
        • Added unit test to verify that after reloading and deleting a SolrCore in managed schema mode, the associated ZkIndexSchemaReader gets de-registered correctly
        Show
        jira-bot ASF subversion and git services added a comment - Commit 34b99fdb1301b48a5e07f0678924fe5bf9033c12 in lucene-solr's branch refs/heads/branch_5x from Timothy Potter [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=34b99fd ] SOLR-8908 : Fixed OnReconnect listener management in ZkController to allow for de-registering listeners. Here's what this commit includes: Added the removeOnReconnectListener method to ZkController to allow OnReconnect listener implementations to de-register; avoids a memory leak Updated ZkIndexSchemaReader to add a CloseHook to the SolrCore it supports to de-register as an OnReconnect listener Added unit test to verify that after reloading and deleting a SolrCore in managed schema mode, the associated ZkIndexSchemaReader gets de-registered correctly
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 14ec48a59412e6822f74716b7307c0872c148431 in lucene-solr's branch refs/heads/branch_5_5 from Timothy Potter
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=14ec48a ]

        SOLR-8908: Fixed OnReconnect listener management in ZkController to allow for de-registering listeners.

        Here's what this commit includes:

        • Added the removeOnReconnectListener method to ZkController to allow OnReconnect listener implementations to de-register; avoids a memory leak
        • Updated ZkIndexSchemaReader to add a CloseHook to the SolrCore it supports to de-register as an OnReconnect listener
        • Added unit test to verify that after reloading and deleting a SolrCore in managed schema mode, the associated ZkIndexSchemaReader gets de-registered correctly
        Show
        jira-bot ASF subversion and git services added a comment - Commit 14ec48a59412e6822f74716b7307c0872c148431 in lucene-solr's branch refs/heads/branch_5_5 from Timothy Potter [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=14ec48a ] SOLR-8908 : Fixed OnReconnect listener management in ZkController to allow for de-registering listeners. Here's what this commit includes: Added the removeOnReconnectListener method to ZkController to allow OnReconnect listener implementations to de-register; avoids a memory leak Updated ZkIndexSchemaReader to add a CloseHook to the SolrCore it supports to de-register as an OnReconnect listener Added unit test to verify that after reloading and deleting a SolrCore in managed schema mode, the associated ZkIndexSchemaReader gets de-registered correctly
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit c4de198d059bf3951523107a52e1b45f20e4d103 in lucene-solr's branch refs/heads/branch_6_0 from Timothy Potter
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=c4de198 ]

        SOLR-8908: Fixed OnReconnect listener management in ZkController to allow for de-registering listeners.

        Here's what this commit includes:

        • Added the removeOnReconnectListener method to ZkController to allow OnReconnect listener implementations to de-register; avoids a memory leak
        • Updated ZkIndexSchemaReader to add a CloseHook to the SolrCore it supports to de-register as an OnReconnect listener
        • Added unit test to verify that after reloading and deleting a SolrCore in managed schema mode, the associated ZkIndexSchemaReader gets de-registered correctly
        Show
        jira-bot ASF subversion and git services added a comment - Commit c4de198d059bf3951523107a52e1b45f20e4d103 in lucene-solr's branch refs/heads/branch_6_0 from Timothy Potter [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=c4de198 ] SOLR-8908 : Fixed OnReconnect listener management in ZkController to allow for de-registering listeners. Here's what this commit includes: Added the removeOnReconnectListener method to ZkController to allow OnReconnect listener implementations to de-register; avoids a memory leak Updated ZkIndexSchemaReader to add a CloseHook to the SolrCore it supports to de-register as an OnReconnect listener Added unit test to verify that after reloading and deleting a SolrCore in managed schema mode, the associated ZkIndexSchemaReader gets de-registered correctly
        Hide
        steve_rowe Steve Rowe added a comment -

        Bulk close issues included in the 6.0.1 release.

        Show
        steve_rowe Steve Rowe added a comment - Bulk close issues included in the 6.0.1 release.

          People

          • Assignee:
            thelabdude Timothy Potter
            Reporter:
            thelabdude Timothy Potter
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development