You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Blake Bender (Jira)" <ji...@apache.org> on 2021/04/29 15:28:00 UTC
[jira] [Resolved] (GEODE-9193) PING message "leaked" at shutdown
due to bad singleton implementation
[ https://issues.apache.org/jira/browse/GEODE-9193?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Blake Bender resolved GEODE-9193.
---------------------------------
Fix Version/s: 1.15.0
Resolution: Fixed
> PING message "leaked" at shutdown due to bad singleton implementation
> ---------------------------------------------------------------------
>
> Key: GEODE-9193
> URL: https://issues.apache.org/jira/browse/GEODE-9193
> Project: Geode
> Issue Type: Sub-task
> Components: native client
> Reporter: Blake Bender
> Assignee: Blake Bender
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.15.0
>
>
> There is a micro-optimization in the native client to prevent creating and tearing down PING messages multiple times, since this message always has the same format. Unfortunately, the implementation uses a pointer, rather than a reference, so exactly one instance of TcrMessagePing is allocated on the heap, and the object is never deleted, making it appear as a leak in any leak-tracking tool.
> {code:java}
> TcrMessagePing* TcrMessage::getPingMessage(CacheImpl* cacheImpl) {
> static auto pingMsg = new TcrMessagePing(new DataOutput(cacheImpl->createDataOutput()), true);
> return pingMsg;
> } {code}
> Changing this from a pointer to a const reference will allow the object to be destructed properly at shutdown.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)