[NETCONF-664] The ConcurrentModificationException was found in the websocket test in restconf-nb-rfc8040. Created: 09/Apr/20 Updated: 03/May/20 Resolved: 21/Apr/20 |
|
| Status: | Resolved |
| Project: | netconf |
| Component/s: | restconf-nb |
| Affects Version/s: | None |
| Fix Version/s: | Magnesium SR1, Aluminium, Sodium SR3 |
| Type: | Bug | Priority: | Medium |
| Reporter: | wang senxiao | Assignee: | wang senxiao |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| 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. |
| Comments |
| Comment by Jamo Luhrsen [ 29/Apr/20 ] |
|
wsx25289, can you provide a few more details to reproduce this issue? I know this is marked resolved with this patch btw, it's weird that this JIRA didn't pick up your patch. I saw you put the correct JIRA: |
| Comment by wang senxiao [ 29/Apr/20 ] |
|
Sorry, I will describe it later。 |
| Comment by wang senxiao [ 03/May/20 ] |
|
operation steps |