Skip to content

Commit

Permalink
RATIS-2065. Avoid the out-of-heap memory OOM phenomenon of frequent c…
Browse files Browse the repository at this point in the history
…reation and deletion of Raft group scenarios. (#1071)
  • Loading branch information
OneSizeFitsQuorum committed Apr 29, 2024
1 parent b0ec114 commit 1fe59e0
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.apache.ratis.statemachine.StateMachine;
import org.apache.ratis.statemachine.StateMachine.DataStream;
import org.apache.ratis.statemachine.TransactionContext;
import org.apache.ratis.thirdparty.io.netty.util.internal.PlatformDependent;
import org.apache.ratis.util.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -242,6 +243,7 @@ void close() {
Optional.ofNullable(flushExecutor).ifPresent(ExecutorService::shutdown);
ConcurrentUtils.shutdownAndWait(TimeDuration.ONE_SECOND.multiply(3),
workerThreadExecutor, timeout -> LOG.warn("{}: shutdown timeout in " + timeout, name));
PlatformDependent.freeDirectBuffer(writeBuffer);
IOUtils.cleanup(LOG, out);
LOG.info("{} close()", name);
}
Expand Down

0 comments on commit 1fe59e0

Please sign in to comment.