@ -188,8 +188,12 @@ public abstract class GossipManager extends Thread implements NotificationListen
|
|||||||
public void shutdown() {
|
public void shutdown() {
|
||||||
_gossipServiceRunning.set(false);
|
_gossipServiceRunning.set(false);
|
||||||
_gossipThreadExecutor.shutdown();
|
_gossipThreadExecutor.shutdown();
|
||||||
passiveGossipThread.shutdown();
|
if (passiveGossipThread != null){
|
||||||
activeGossipThread.shutdown();
|
passiveGossipThread.shutdown();
|
||||||
|
}
|
||||||
|
if (activeGossipThread != null){
|
||||||
|
activeGossipThread.shutdown();
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
boolean result = _gossipThreadExecutor.awaitTermination(1000, TimeUnit.MILLISECONDS);
|
boolean result = _gossipThreadExecutor.awaitTermination(1000, TimeUnit.MILLISECONDS);
|
||||||
if (!result){
|
if (!result){
|
||||||
|
@ -64,7 +64,6 @@ abstract public class PassiveGossipThread implements Runnable {
|
|||||||
GossipService.LOGGER.debug("I am " + _gossipManager.getMyself());
|
GossipService.LOGGER.debug("I am " + _gossipManager.getMyself());
|
||||||
} catch (SocketException ex) {
|
} catch (SocketException ex) {
|
||||||
GossipService.LOGGER.warn(ex);
|
GossipService.LOGGER.warn(ex);
|
||||||
_server = null;
|
|
||||||
throw new RuntimeException(ex);
|
throw new RuntimeException(ex);
|
||||||
}
|
}
|
||||||
_keepRunning = new AtomicBoolean(true);
|
_keepRunning = new AtomicBoolean(true);
|
||||||
@ -139,7 +138,9 @@ abstract public class PassiveGossipThread implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void shutdown() {
|
public void shutdown() {
|
||||||
|
try {
|
||||||
_server.close();
|
_server.close();
|
||||||
|
} catch (RuntimeException ex){ }
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user