Merge branch 'master' into wip-sync-artery-patriknw

This commit is contained in:
Patrik Nordwall 2016-06-03 11:09:17 +02:00
commit 839ec5f167
757 changed files with 9166 additions and 6642 deletions

View file

@ -4,27 +4,24 @@
package akka.remote.testconductor
import language.postfixOps
import akka.actor.{ Actor, ActorRef, LoggingFSM, Props, NoSerializationVerificationNeeded }
import RemoteConnection.getAddrString
import TestConductorProtocol._
import org.jboss.netty.channel.{ Channel, SimpleChannelUpstreamHandler, ChannelHandlerContext, ChannelStateEvent, MessageEvent }
import scala.concurrent.duration._
import akka.pattern.ask
import scala.concurrent.Await
import akka.event.{ LoggingAdapter, Logging }
import scala.util.control.NoStackTrace
import akka.event.LoggingReceive
import java.net.InetSocketAddress
import scala.concurrent.Future
import akka.actor.{ OneForOneStrategy, SupervisorStrategy, Status, Address }
import java.util.concurrent.ConcurrentHashMap
import akka.util.{ Timeout }
import scala.reflect.classTag
import akka.ConfigurationException
import akka.actor.{ Actor, ActorRef, Address, DeadLetterSuppression, Deploy, FSM, LoggingFSM, NoSerializationVerificationNeeded, OneForOneStrategy, Props, Status, SupervisorStrategy }
import akka.AkkaException
import akka.ConfigurationException
import akka.event.LoggingReceive
import akka.event.{ Logging, LoggingAdapter }
import akka.pattern.ask
import akka.remote.transport.ThrottlerTransportAdapter.Direction
import akka.actor.Deploy
import akka.actor.DeadLetterSuppression
import akka.util.Timeout
import java.net.InetSocketAddress
import java.util.concurrent.ConcurrentHashMap
import org.jboss.netty.channel.{ Channel, ChannelHandlerContext, ChannelStateEvent, MessageEvent, SimpleChannelUpstreamHandler }
import RemoteConnection.getAddrString
import scala.concurrent.Await
import scala.concurrent.duration._
import scala.concurrent.Future
import scala.reflect.classTag
import scala.util.control.NoStackTrace
/**
* The conductor is the one orchestrating the test: it governs the
@ -431,7 +428,7 @@ private[akka] class Controller(private var initialParticipants: Int, controllerP
}
fsm ! ToClient(BarrierResult("initial startup", false))
} else {
nodes += name -> c
nodes += name c
if (initialParticipants <= 0) fsm ! ToClient(Done)
else if (nodes.size == initialParticipants) {
for (NodeInfo(_, _, client) nodes.values) client ! ToClient(Done)
@ -451,7 +448,7 @@ private[akka] class Controller(private var initialParticipants: Int, controllerP
case _: FailBarrier barrier forward op
case GetAddress(node)
if (nodes contains node) sender() ! ToClient(AddressReply(node, nodes(node).addr))
else addrInterest += node -> ((addrInterest get node getOrElse Set()) + sender())
else addrInterest += node ((addrInterest get node getOrElse Set()) + sender())
case _: Done //FIXME what should happen?
}
case op: CommandOp
@ -523,6 +520,7 @@ private[akka] object BarrierCoordinator {
private[akka] class BarrierCoordinator extends Actor with LoggingFSM[BarrierCoordinator.State, BarrierCoordinator.Data] {
import BarrierCoordinator._
import Controller._
import FSM.`→`
// this shall be set to true if all subsequent barriers shall fail
var failed = false
@ -567,8 +565,8 @@ private[akka] class BarrierCoordinator extends Actor with LoggingFSM[BarrierCoor
}
onTransition {
case Idle -> Waiting setTimer("Timeout", StateTimeout, nextStateData.deadline.timeLeft, false)
case Waiting -> Idle cancelTimer("Timeout")
case Idle Waiting setTimer("Timeout", StateTimeout, nextStateData.deadline.timeLeft, false)
case Waiting Idle cancelTimer("Timeout")
}
when(Waiting) {

View file

@ -133,7 +133,8 @@ private[akka] class MsgDecoder extends OneToOneDecoder {
case BarrierOp.Succeeded BarrierResult(barrier.getName, true)
case BarrierOp.Failed BarrierResult(barrier.getName, false)
case BarrierOp.Fail FailBarrier(barrier.getName)
case BarrierOp.Enter EnterBarrier(barrier.getName,
case BarrierOp.Enter EnterBarrier(
barrier.getName,
if (barrier.hasTimeout) Option(Duration.fromNanos(barrier.getTimeout)) else None)
}
} else if (w.hasFailure) {

View file

@ -192,8 +192,8 @@ private[akka] class ClientFSM(name: RoleName, controllerAddr: InetSocketAddress)
case Event(ToServer(msg), d @ Data(Some(channel), None))
channel.write(msg)
val token = msg match {
case EnterBarrier(barrier, timeout) Some(barrier -> sender())
case GetAddress(node) Some(node.name -> sender())
case EnterBarrier(barrier, timeout) Some(barrier sender())
case GetAddress(node) Some(node.name sender())
case _ None
}
stay using d.copy(runningOp = token)
@ -274,13 +274,13 @@ private[akka] class ClientFSM(name: RoleName, controllerAddr: InetSocketAddress)
* INTERNAL API.
*/
private[akka] class PlayerHandler(
server: InetSocketAddress,
server: InetSocketAddress,
private var reconnects: Int,
backoff: FiniteDuration,
poolSize: Int,
fsm: ActorRef,
log: LoggingAdapter,
scheduler: Scheduler)(implicit executor: ExecutionContext)
backoff: FiniteDuration,
poolSize: Int,
fsm: ActorRef,
log: LoggingAdapter,
scheduler: Scheduler)(implicit executor: ExecutionContext)
extends SimpleChannelUpstreamHandler {
import ClientFSM._

View file

@ -41,7 +41,7 @@ abstract class MultiNodeConfig {
*/
def nodeConfig(roles: RoleName*)(configs: Config*): Unit = {
val c = configs.reduceLeft(_ withFallback _)
_nodeConf ++= roles map { _ -> c }
_nodeConf ++= roles map { _ c }
}
/**
@ -78,7 +78,7 @@ abstract class MultiNodeConfig {
}
def deployOn(role: RoleName, deployment: String): Unit =
_deployments += role -> ((_deployments get role getOrElse Vector()) :+ deployment)
_deployments += role ((_deployments get role getOrElse Vector()) :+ deployment)
def deployOnAll(deployment: String): Unit = _allDeploy :+= deployment