Skip to content
Browse files

Merge pull request #75 from pruivo/t_toa_fix

TOA: bugfix in the previous pull request
  • Loading branch information...
2 parents 7cb117b + 1a3be67 commit 81591ffb9d514f85fa7da115f25a204ad59985ee @pruivo pruivo committed Feb 21, 2013
View
2 src/org/jgroups/protocols/tom/DeliveryManagerImpl.java
@@ -114,7 +114,7 @@ public final void removeLeavers(Collection<Address> leavers) {
}
}
deliverySet.removeAll(toRemove);
- if (deliverySet.first().isReadyToDeliver()) {
+ if (!deliverySet.isEmpty() && deliverySet.first().isReadyToDeliver()) {
deliverySet.notify();
}
}
View
4 src/org/jgroups/protocols/tom/DeliveryThread.java
@@ -32,6 +32,10 @@ public void start(DeliveryManager deliveryManager) {
start();
}
+ public void setLocalAddress(String localAddress) {
+ setName("TOA-Delivery-Thread-" + localAddress);
+ }
+
@Override
public void start() {
if (deliveryManager == null) {
View
7 src/org/jgroups/protocols/tom/TOA.java
@@ -68,6 +68,7 @@ public Object down(Event evt) {
return null;
case Event.SET_LOCAL_ADDRESS:
this.localAddress = (Address) evt.getArg();
+ this.deliverThread.setLocalAddress(localAddress.toString());
break;
case Event.VIEW_CHANGE:
handleViewChange((View) evt.getArg());
@@ -115,6 +116,7 @@ public Object up(Event evt) {
break;
case Event.SET_LOCAL_ADDRESS:
this.localAddress = (Address) evt.getArg();
+ this.deliverThread.setLocalAddress(localAddress.toString());
break;
default:
break;
@@ -210,10 +212,7 @@ private void sendTotalOrderAnycastMessage(Collection<Address> destinations, Mess
}
if (destinations.isEmpty()) {
- if (warn) {
- log.warn("sending an anycast with an empty list");
- }
- throw new IllegalStateException("AnycastAddress must have at least one element");
+ destinations.addAll(currentView.getMembers());
}
if (destinations.size() == 1) {

0 comments on commit 81591ff

Please sign in to comment.
Something went wrong with that request. Please try again.