diff --git a/akka-multi-node-testkit/src/main/scala/akka/remote/testconductor/Player.scala b/akka-multi-node-testkit/src/main/scala/akka/remote/testconductor/Player.scala index 94ddf5760c..f0d8a1a43f 100644 --- a/akka-multi-node-testkit/src/main/scala/akka/remote/testconductor/Player.scala +++ b/akka-multi-node-testkit/src/main/scala/akka/remote/testconductor/Player.scala @@ -317,7 +317,7 @@ private[akka] class PlayerHandler( val channel = event.getChannel log.debug("disconnected from {}", getAddrString(channel)) fsm ! PoisonPill - RemoteConnection.shutdown(channel) + executor.execute(new Runnable { def run = RemoteConnection.shutdown(channel) }) // Must be shutdown outside of the Netty IO pool } override def messageReceived(ctx: ChannelHandlerContext, event: MessageEvent) = { diff --git a/akka-multi-node-testkit/src/main/scala/akka/remote/testconductor/RemoteConnection.scala b/akka-multi-node-testkit/src/main/scala/akka/remote/testconductor/RemoteConnection.scala index 08ce020b3c..94a76a21d3 100644 --- a/akka-multi-node-testkit/src/main/scala/akka/remote/testconductor/RemoteConnection.scala +++ b/akka-multi-node-testkit/src/main/scala/akka/remote/testconductor/RemoteConnection.scala @@ -71,7 +71,6 @@ private[akka] object RemoteConnection { case _ ⇒ "[unknown]" } - def shutdown(channel: Channel) = { - channel.getFactory.releaseExternalResources() - } + def shutdown(channel: Channel) = + try channel.close() finally try channel.getFactory.shutdown() finally channel.getFactory.releaseExternalResources() }