Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1072 from zalando/ARUHA-2359
Browse files Browse the repository at this point in the history
close zk session after unregistering session
  • Loading branch information
adyach authored Jun 21, 2019
2 parents e2d7e2b + cda8d12 commit e55cde3
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@ public CleanupState(@Nullable final Exception e) {
public void onEnter() {
try {
getContext().unregisterAuthorizationUpdates();
getContext().getZkClient().close();
} catch (final RuntimeException ex) {
getLog().error("Unexpected fail during removing callback for registration updates", ex);
} catch (IOException e) {
getLog().error("Unexpected fail to release zk connection", e);
}
try {
if (null != exception) {
Expand All @@ -36,6 +33,12 @@ public void onEnter() {
} finally {
switchState(StreamingContext.DEAD_STATE);
}

try {
getContext().getZkClient().close();
} catch (final IOException e) {
getLog().error("Unexpected fail to release zk connection", e);
}
}
}
}

0 comments on commit e55cde3

Please sign in to comment.