}
// TODO(wfarner): Consider using something like guava's Closer to abstractly tear down
// resources here.
try {
LeaderControl control = leaderControl.get();
if (control != null) {
try {
control.leave();
} catch (JoinException e) {
LOG.log(Level.WARNING, "Failed to leave leadership: " + e, e);
} catch (ServerSet.UpdateException e) {
LOG.log(Level.WARNING, "Failed to leave server set: " + e, e);
}