Details
-
Bug
-
Status: Resolved
-
Medium
-
Resolution: Done
-
None
-
None
Description
The specific code in AbstractCommonSubscriber.java is as follows. When the yang notification is monitored, the websocket message is sent.
/**code**/
synchronized void post(final String data) {
for (final WebSocketSessionHandler subscriber : subscribers) {
final Optional<InetSocketAddress> remoteEndpointAddress = subscriber.getRemoteEndpointAddress();
if (remoteEndpointAddress.isPresent()) {
subscriber.sendDataMessage(data);
LOG.debug("Data was sent to subscriber {} on address {}:", this, remoteEndpointAddress.get());
} else {
// removal is probably not necessary, because it will be removed explicitly soon after invocation of
// onWebSocketClosed(..) in handler; but just to be sure ...
subscribers.remove(subscriber);
LOG.debug("Subscriber for {} was removed - web-socket session is not open.", this);
}
}
}
In the process of traversing the set, delete the element, will cause ConcurrentModificationException.
Attachments
| # | Subject | Branch | Project | Status | CR | V |
|---|---|---|---|---|---|---|
| 88989,4 | Fix defensive subscriber removal | stable/sodium | netconf | Status: MERGED | +2 | +1 |
| 89041,2 | Fix defensive subscriber removal | master | netconf | Status: MERGED | +2 | +1 |
| 89184,1 | Fix defensive subscriber removal | stable/magnesium | netconf | Status: MERGED | +2 | +1 |