[
https://issues.apache.org/jira/browse/ZOOKEEPER-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13279836#comment-13279836
]
Paul Giannaros commented on ZOOKEEPER-1470:
-------------------------------------------
In fact, close() should decref all pending callbacks for the same reason. This
will be harder to implement, so maybe it should go into a separate issue.
> zkpython: close() should delete any watcher
> -------------------------------------------
>
> Key: ZOOKEEPER-1470
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1470
> Project: ZooKeeper
> Issue Type: Bug
> Components: contrib-bindings
> Affects Versions: 3.4.3
> Reporter: Paul Giannaros
> Priority: Minor
> Labels: memory_leak, python
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> When calling zookeeper.close(handle), any connection watcher for the handle
> is not deleted. This is a source of memory leaks for applications that create
> and close lots of connections. Its damage can be mitigated to some degree by
> changing the watcher to some function that won't keep references to instances
> alive before calling close.
> The fix is just to add a free_pywatcher(..) call in the close sequence.
> Alternatively you could allow set_watcher(handle, None) as a way of deleting
> the watcher, but it's probably best to take care of it on close too.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira