We are indirecting to current behavior, just inline this login in
RaftActor.
Change-Id: I2ed629cd67e032058ecf922c9b51a31cea7e8d15
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
}
@Override
+ @SuppressWarnings("checkstyle:IllegalCatch")
public void postStop() throws Exception {
- context.close();
+ final var behavior = context.getCurrentBehavior();
+ if (behavior != null) {
+ try {
+ behavior.close();
+ } catch (Exception e) {
+ LOG.warn("{}: Error closing behavior {}", memberId(), behavior.state(), e);
+ }
+ }
super.postStop();
}
return fileBackedOutputStreamFactory;
}
- @SuppressWarnings("checkstyle:IllegalCatch")
- void close() {
- if (currentBehavior != null) {
- try {
- currentBehavior.close();
- } catch (Exception e) {
- LOG.debug("{}: Error closing behavior {}", id, currentBehavior.state(), e);
- }
- }
- }
-
@Override
public RaftActorLeadershipTransferCohort getRaftActorLeadershipTransferCohort() {
return leadershipTransferCohort;