Skip to content

Commit

Permalink
Fix memory leak in Raft member selectors. (#1014)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuujo authored and johnou committed Jul 2, 2019
1 parent b0d068c commit be6355f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
Expand Up @@ -306,4 +306,11 @@ protected MemberId next() {
return currentNode;
}
}

/**
* Closes the connection.
*/
public void close() {
selector.close();
}
}
Expand Up @@ -216,6 +216,8 @@ public CompletableFuture<Void> close() {
attempt.fail(new PrimitiveException.ClosedSession("session closed"));
}
attempts.clear();
sessionConnection.close();
leaderConnection.close();
return CompletableFuture.completedFuture(null);
}

Expand Down
Expand Up @@ -140,6 +140,7 @@ private void handlePublish(PublishRequest request) {
*/
public CompletableFuture<Void> close() {
protocol.unregisterPublishListener(state.getSessionId());
memberSelector.close();
return CompletableFuture.completedFuture(null);
}
}

0 comments on commit be6355f

Please sign in to comment.