Don't replace the active connection with a passive one. See #2654

This commit is contained in:
Björn Antonsson 2012-11-22 10:59:20 +01:00
parent 3c946cc8f0
commit 41ecd4749c
2 changed files with 4 additions and 14 deletions

View file

@ -104,7 +104,7 @@ abstract class MultiNodeConfig {
else ConfigFactory.empty
val configs = (_nodeConf get myself).toList ::: _commonConf.toList ::: transportConfig :: MultiNodeSpec.nodeConfig :: MultiNodeSpec.baseConfig :: Nil
configs reduce (_ withFallback _)
configs reduceLeft (_ withFallback _)
}
private[testkit] def deployments(node: RoleName): immutable.Seq[String] = (_deployments get node getOrElse Nil) ++ _allDeploy

View file

@ -243,10 +243,10 @@ private[akka] class NettyRemoteTransport(_system: ExtendedActorSystem, _provider
}
}
def bindClient(remoteAddress: Address, client: RemoteClient, putIfAbsent: Boolean = false): Boolean = {
def bindClient(remoteAddress: Address, client: RemoteClient): Boolean = {
clientsLock.writeLock().lock()
try {
if (putIfAbsent && remoteClients.contains(remoteAddress)) false
if (remoteClients.contains(remoteAddress)) false
else {
client.connect()
remoteClients.put(remoteAddress, client).foreach(_.shutdown())
@ -257,17 +257,7 @@ private[akka] class NettyRemoteTransport(_system: ExtendedActorSystem, _provider
}
}
def unbindClient(remoteAddress: Address): Unit = {
clientsLock.writeLock().lock()
try {
remoteClients foreach {
case (k, v)
if (v.isBoundTo(remoteAddress)) { v.shutdown(); remoteClients.remove(k) }
}
} finally {
clientsLock.writeLock().unlock()
}
}
def unbindClient(remoteAddress: Address): Unit = shutdownClientConnection(remoteAddress)
def shutdownClientConnection(remoteAddress: Address): Boolean = {
clientsLock.writeLock().lock()