Run safelyDisconnect() on event loop 67/102967/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 18 Oct 2022 09:10:15 +0000 (11:10 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 31 Oct 2022 07:19:19 +0000 (08:19 +0100)
commitb3d8b08aee898805d55595c0bf667954dfc6be94
tree9996fd77de9f5e3b4cd9afa0ce82d8359ff504c4
parent7204cd134ca9a0925ed58c6e8125fdc75626bcba
Run safelyDisconnect() on event loop

The disconnect() operation needs to inform handlers of state
transitions, which should not be delayed. Netty provides indirects these
calls silently on thread mismatch, which we do not want.

Make sure to schedule safelyDisconnect() on the event loop, so that that
it cannot run concurrently with other channel tasks.

JIRA: NETCONF-905
Change-Id: Iffe98db142f9c407fca9f92e5d336a0484ef1eff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit f2cf330ae8041264a599b8f8b5652ee54716eb88)
(cherry picked from commit cd0fe54e116b26fd4778fe68001e3231f76ba9df)
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java
netconf/netconf-netty-util/src/test/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandlerTest.java