summaryrefslogtreecommitdiff
path: root/same/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'same/src/main/java')
-rw-r--r--same/src/main/java/com/orbekk/same/MasterServiceImpl.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/same/src/main/java/com/orbekk/same/MasterServiceImpl.java b/same/src/main/java/com/orbekk/same/MasterServiceImpl.java
index f8044e4..ced0dba 100644
--- a/same/src/main/java/com/orbekk/same/MasterServiceImpl.java
+++ b/same/src/main/java/com/orbekk/same/MasterServiceImpl.java
@@ -68,7 +68,14 @@ public class MasterServiceImpl implements MasterService, UrlReceiver, Runnable {
}
private synchronized void removeParticipant(String url) {
- logger.error("Remove participant {}: Operation not supported", url);
+ List<String> participants = participants();
+ if (participants.contains(url)) {
+ logger.warn("RemoveParticipant({})", url);
+ participants.remove(url);
+ state.updateFromObject(".participants", participants,
+ state.getRevision(".participants") + 1);
+ notifyAll();
+ }
}
private void broadcastNewComponents(List<String> destinations,
@@ -82,7 +89,7 @@ public class MasterServiceImpl implements MasterService, UrlReceiver, Runnable {
c.getRevision());
}
} catch (Exception e) {
- logger.warn("Client {} failed to receive state update.");
+ logger.info("Client {} failed to receive state update.", url);
removeParticipant(url);
}
}