You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Andrzej Bialecki (JIRA)" <ji...@apache.org> on 2019/04/11 07:07:00 UTC

[jira] [Commented] (SOLR-13393) ZkClientClusterStateProvider can leak ZkStateReader (and associated watcher threads) if background threads attempt to use it after close() .

    [ https://issues.apache.org/jira/browse/SOLR-13393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16815132#comment-16815132 ] 

Andrzej Bialecki  commented on SOLR-13393:
------------------------------------------

Good catch! the patch looks good to me.

> ZkClientClusterStateProvider can leak ZkStateReader (and associated watcher threads) if background threads attempt to use it after close() .
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-13393
>                 URL: https://issues.apache.org/jira/browse/SOLR-13393
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Hoss Man
>            Assignee: Hoss Man
>            Priority: Major
>         Attachments: SOLR-13393.patch, SOLR-13393.patch
>
>
> while digging into some test failures related to leaked ZkStateReader objects, i noticed a pattern which i beleive can be explained by the fact that ZkClientClusterStateProvider does not complain/fail if some caller tries to connect()/use it after it's already been closed – in this situation it will just re-create a new ZkStateReader (which is later leaked)
> So in in situations where background/timer threads use a SolrClientCloudManager/ZkClientClusterStateProvider, we might see...
> {noformat}
> T1 : start shutdown...
> T1 :  ...SolrClientCloudManager.close()...
> T1 :   ...ZkClientClusterStateProvider.close()...
> T1 :    ...ZkStateReader.close()
> T1 :    ...zkStateReader = null;
> T 2: run background thread/task/trigger...
> T 2:  ...get ZkClientClusterStateProvider
> T 2:  ...call ZkClientClusterStateProvider.connect()
> T 2:   ...zkStateReader = new ZkStateReader()                 /* LEAKED */
> T 2:  ... do something with ZkClientClusterStateProvider
> T 2:  ...finish background thread/task/trigger
> T1 :  ...finish shutdown of ZkClientClusterStateProvider / SolrClientCloudManager
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org