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

ASF subversion and git services commented on GEODE-10338:
---------------------------------------------------------

Commit 754e5c3b9cdd0cd6eeebe9a28443ff1f1cad23e0 in geode's branch 
refs/heads/develop from Jakov Varenina
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=754e5c3b9c ]

GEODE-10338: Fix LogWriterAppender shutdown (#7725)

* GEODE-10338: Fix LogWriterAppender shutdown

When a stop session is called on the LogWriterAppender, it closes the
ManagerLogWriter's files. Still, it does not release
ManagerLogWriter's reference, so the LogWriterAppender instance is
kept around after disconnect. This situation ends up keeping the
InternalDistributedSystem alive.

The fix is to clear the LogWriterAppender's reference to the
ManagerLogWriter when the appender session is stopped.

* Update after review

* Fix integration test

* Add nullptr check in stopSession()

> LogWriterAppender keeps a InternalDistributedSystem alive after disconnect
> --------------------------------------------------------------------------
>
>                 Key: GEODE-10338
>                 URL: https://issues.apache.org/jira/browse/GEODE-10338
>             Project: Geode
>          Issue Type: Bug
>          Components: logging
>            Reporter: Darrel Schneider
>            Assignee: Jakov Varenina
>            Priority: Major
>              Labels: blocks-1.16.0, pull-request-available
>
> The LogWriterAppender has a "logWriter" field that can be a ManagerLogWriter. 
> When stopSession is called on the appender, it closes the ManagerLogWriter's 
> files but does not release its reference to it and the LogWriterAppender 
> instance is kept around after disconnect. So this ends up keeping the 
> InternalDistributedSystem alive.
> To fix this change LogWriterAppender.stopSession like so:
> {code:java}
>   public synchronized void stopSession() {
>     LOGGER.info("Stopping session in {}.", this);
>     if (logWriter == null) {
>       // we are probably already paused but make sure we are
>       pause();
>       return;
>     }
>     logWriter.shuttingDown();
>     pause();
>     logWriter.closingLogFile();
>     logWriter = null;
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to