Run safelyDisconnect() on event loop 21/102721/5
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 18 Oct 2022 09:10:15 +0000 (11:10 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 18 Oct 2022 11:57:25 +0000 (13:57 +0200)
commitf2cf330ae8041264a599b8f8b5652ee54716eb88
tree1d5693ee62216017109c8e61898164ec56cf7592
parent1b4958b336a80f2ab62164196de8f90a6f083f03
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>
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