Disallow re-joining, see #2873
* Disallow join requests when already part of a cluster * Remove wipe state when joining, since join can only be performed from empty state * When trying to join, only accept gossip from that member * Ignore gossips from unknown (and unreachable) members * Make sure received gossip contains selfAddress * Test join of fresh node with same host:port * Remove JoinTwoClustersSpec * Welcome message as reply to Join * Retry unsucessful join request * AddressUidExtension * Uid in cluster Member identifier To be able to distinguish nodes with same host:port after restart. * Ignore gossip with wrong uid * Renamed Remove command to Shutdown * Use uid in vclock identifier * Update sample, Member apply is private * Disabled config duration syntax and cleanup of io settings * Update documentation
This commit is contained in:
parent
cdf717e855
commit
9e56ab6fe5
35 changed files with 795 additions and 546 deletions
|
|
@ -15,27 +15,26 @@ import akka.actor._
|
|||
import com.typesafe.config.Config
|
||||
import akka.actor.Terminated
|
||||
import akka.io.IO.HasFailureMessage
|
||||
import akka.util.Helpers.Requiring
|
||||
|
||||
abstract class SelectionHandlerSettings(config: Config) {
|
||||
import config._
|
||||
|
||||
val MaxChannels = getString("max-channels") match {
|
||||
val MaxChannels: Int = getString("max-channels") match {
|
||||
case "unlimited" ⇒ -1
|
||||
case _ ⇒ getInt("max-channels")
|
||||
case _ ⇒ getInt("max-channels") requiring (_ > 0, "max-channels must be > 0 or 'unlimited'")
|
||||
}
|
||||
val SelectTimeout = getString("select-timeout") match {
|
||||
val SelectTimeout: Duration = getString("select-timeout") match {
|
||||
case "infinite" ⇒ Duration.Inf
|
||||
case x ⇒ Duration(x)
|
||||
case _ ⇒ Duration(getMilliseconds("select-timeout"), MILLISECONDS) requiring (
|
||||
_ >= Duration.Zero, "select-timeout must not be negative")
|
||||
}
|
||||
val SelectorAssociationRetries = getInt("selector-association-retries")
|
||||
val SelectorAssociationRetries: Int = getInt("selector-association-retries") requiring (
|
||||
_ >= 0, "selector-association-retries must be >= 0")
|
||||
|
||||
val SelectorDispatcher = getString("selector-dispatcher")
|
||||
val WorkerDispatcher = getString("worker-dispatcher")
|
||||
val TraceLogging = getBoolean("trace-logging")
|
||||
|
||||
require(MaxChannels == -1 || MaxChannels > 0, "max-channels must be > 0 or 'unlimited'")
|
||||
require(SelectTimeout >= Duration.Zero, "select-timeout must not be negative")
|
||||
require(SelectorAssociationRetries >= 0, "selector-association-retries must be >= 0")
|
||||
val SelectorDispatcher: String = getString("selector-dispatcher")
|
||||
val WorkerDispatcher: String = getString("worker-dispatcher")
|
||||
val TraceLogging: Boolean = getBoolean("trace-logging")
|
||||
|
||||
def MaxChannelsPerSelector: Int
|
||||
|
||||
|
|
@ -180,7 +179,7 @@ private[io] class SelectionHandler(manager: ActorRef, settings: SelectionHandler
|
|||
SelectTimeout match {
|
||||
case Duration.Zero ⇒ () ⇒ selector.selectNow()
|
||||
case Duration.Inf ⇒ () ⇒ selector.select()
|
||||
case x ⇒ val millis = x.toMillis; () ⇒ selector.select(millis)
|
||||
case x ⇒ { val millis = x.toMillis; () ⇒ selector.select(millis) }
|
||||
}
|
||||
def tryRun() {
|
||||
if (doSelect() > 0) {
|
||||
|
|
@ -197,7 +196,7 @@ private[io] class SelectionHandler(manager: ActorRef, settings: SelectionHandler
|
|||
readyOps match {
|
||||
case OP_READ ⇒ connection ! ChannelReadable
|
||||
case OP_WRITE ⇒ connection ! ChannelWritable
|
||||
case OP_READ_AND_WRITE ⇒ connection ! ChannelWritable; connection ! ChannelReadable
|
||||
case OP_READ_AND_WRITE ⇒ { connection ! ChannelWritable; connection ! ChannelReadable }
|
||||
case x if (x & OP_ACCEPT) > 0 ⇒ connection ! ChannelAcceptable
|
||||
case x if (x & OP_CONNECT) > 0 ⇒ connection ! ChannelConnectable
|
||||
case x ⇒ log.warning("Invalid readyOps: [{}]", x)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue