mirror of https://github.com/apache/activemq.git
Added synchronized when iterating over SynchronizedList as per Java specifications
This commit is contained in:
parent
d730e35f9d
commit
948e9809ca
|
@ -858,14 +858,17 @@ public class TransportConnection implements Connection, Task, CommandVisitor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Cascade the connection stop to temp destinations.
|
// Cascade the connection stop to temp destinations.
|
||||||
for (Iterator<DestinationInfo> iter = cs.getTempDestinations().iterator(); iter.hasNext(); ) {
|
List<DestinationInfo> tempDestinations = cs.getTempDestinations();
|
||||||
DestinationInfo di = iter.next();
|
synchronized (tempDestinations) {
|
||||||
try {
|
for (Iterator<DestinationInfo> iter = tempDestinations.iterator(); iter.hasNext(); ) {
|
||||||
broker.removeDestination(cs.getContext(), di.getDestination(), 0);
|
DestinationInfo di = iter.next();
|
||||||
} catch (Throwable e) {
|
try {
|
||||||
SERVICELOG.warn("Failed to remove tmp destination {}", di.getDestination(), e);
|
broker.removeDestination(cs.getContext(), di.getDestination(), 0);
|
||||||
|
} catch (Throwable e) {
|
||||||
|
SERVICELOG.warn("Failed to remove tmp destination {}", di.getDestination(), e);
|
||||||
|
}
|
||||||
|
iter.remove();
|
||||||
}
|
}
|
||||||
iter.remove();
|
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
broker.removeConnection(cs.getContext(), cs.getInfo(), transportException.get());
|
broker.removeConnection(cs.getContext(), cs.getInfo(), transportException.get());
|
||||||
|
|
Loading…
Reference in New Issue