[NETCONF-533] channelActive may happen later than handleMessage when connect devices. This will result a java.lang.IllegalStateException and failed the connection. Created: 29/Mar/18 Updated: 06/Aug/18 Resolved: 06/Aug/18 |
|
| Status: | Resolved |
| Project: | netconf |
| Component/s: | netconf |
| Affects Version/s: | None |
| Fix Version/s: | Fluorine |
| Type: | Bug | Priority: | Medium |
| Reporter: | Wei Jiang | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
connect enough device, or use test case |
||
| Description |
|
This was not a inevitable phenomenon, it occured when i tried to connect 500 devices. I believe that when there are many devices to connect, channelActive may happen later than handleMessage because device will not wait for your hello message. When you handle the message, you need to get session for hello message ,then change state to ESTABLISHED , but the state is IDLE now (Only channelActive can invoke startNegotiation method and change state to OPEN_WAIT.), change will result a IllegalStateException. And this happens again and again even if reconnect strategy invoke reconnect. At last, the device will not connect success. Test case show the stack.(https://git.opendaylight.org/gerrit/#/c/69738/4/netconf/netconf-client/src/test/java/org/opendaylight/netconf/client/NetconfClientSessionNegotiatorTest.java) java.lang.IllegalStateException: Cannot change state from IDLE to ESTABLISHED for chanel at com.google.common.base.Preconditions.checkState(Preconditions.java:836) |
| Comments |
| Comment by Wei Jiang [ 29/Mar/18 ] |
|
i have give a soution on https://git.opendaylight.org/gerrit/#/c/69738/ when you get a message from device, you can check whether channelActive invoke already to ensure the state have been changed to OPEN_WAIT and it is legal to change state to ENSTABLISHED |
| Comment by Jakub Morvay [ 06/Aug/18 ] |