zookeeper-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [zookeeper] xoiss opened a new pull request #1000: ZOOKEEPER-2894: Memory and completions leak on zookeeper_close
Date Sun, 23 Jun 2019 18:56:36 GMT
xoiss opened a new pull request #1000: ZOOKEEPER-2894: Memory and completions leak on zookeeper_close
URL: https://github.com/apache/zookeeper/pull/1000
 
 
   If I call `zookeeper_close()` when the call-stack does not pass through any of zookeeper
mechanics (for example, some of completion handler called back by zookeeper) the following
happens:
   1. If there are requests waiting for responses in `zh.sent_requests` queue, they all are
removed from this queue and each of them is "completed" with personal fake response having
status `ZCLOSING`. Such fake responses are put into `zh.completions_to_process` queue. It's
Ok
   2. But then, `zh.completions_to_process` queue is left unhandled. **Neither completion
callbacks are called, nor dynamic memory allocated for fake responses is freed**
   3. Different structures within `zh` are dismissed and finally `zh` is freed
   
   Consequently we have a tiny **memory leak** and, which is much more important, **completions
leak**. I.e. completions are not called at all.
   
   This is not the case if I call `zookeeper_close()` when the call-stack does pass through
some of zookeeper mechanics. Here, zookeeper client handles completions properly.
   
   Proposed changes remove this defects.
   
   For more details see: https://issues.apache.org/jira/browse/ZOOKEEPER-2894

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message