Commit graph

16 commits

Author SHA1 Message Date
Patrik Nordwall
a021eb5ff4 flush messages on shutdown, #20811
* StreamSupervisor as system actor so that it is
  stopped after ordinary actors
* when transport is shutdown send flush message to all
  outbound associations (over control stream) and wait for ack
  or timeout
2016-07-01 12:29:05 +02:00
Johan Andrén
c8eadd7d08 Porting RemotingSpec to artery #20714 2016-06-10 16:27:06 +02:00
Patrik Nordwall
5c234940c6 make remote deployment work with Artery, #20715
There were two related problems with remote deployment when
using Artery.

* DaemonMsgCreate is not a SystemMessage, but must be sent over the control stream because
  remote deployment process depends on message ordering for DaemonMsgCreate and Watch messages.
  It must also be sent over the ordinary message stream so that it arrives (and creates the
  destination) before the first ordinary message arrives.
* The first point solves the creation of the remote deployed actor but it's not enough.
  Resolve of the recipient actor ref may still happen before the actor is created. This
  is solved by retrying the resolve for the first message of a remote deployed actor.
2016-06-10 15:15:57 +02:00
Johan Andrén
d6c048f59a A simpler ActorRefProvider config #20649 (#20767)
* Provide shorter aliases for the ActorRefProviders #20649
* Use the new actorefprovider aliases throughout code and docs
* Cleaner alias replacement logic
2016-06-10 15:04:13 +02:00
Patrik Nordwall
7ce6dffabf send dropped system messages to deadLetters
* publish remote lifecycle event for quarantined
2016-06-10 13:21:17 +02:00
Patrik Nordwall
7a1a316e8a reduce allocations with specialized ImmutableLongMap (#20750)
* reduce allocations with specialized ImmutableLongMap

* backed by arrays, allocation free lookups with binary search
* use it for UID -> Association Map
* pass Association in InboundEnvelope to reduce to only
  one lookup per incoming message
* use ImmutableLongMap instead of the QuarantinedUIDSet
2016-06-10 13:04:23 +02:00
Patrik Nordwall
a814034342 Option value class, to avoid allocations for optional sender 2016-06-07 18:58:59 +02:00
Patrik Nordwall
7505393c89 initiate new handshake after restart of receiving system, #20568
* we don't want to include the full origin address in each message,
  only the UID
* that means that the restarted receiving system can't initate a
  new handshake immediately when it sees message from unknown origin
* instead we inject HandshakeReq from the sending system once in a while
  (1 per second) which will trigger the new handshake
* any messages that arrives before the HandshakeReq are dropped, but
  that is fine since the system was just restarted anyway
* note that the injected handshake is only done for active connections,
  when a message is sent
* also changed the UID to a Long, but there are more places in old remoting
  that must be changed before we actually can use a Long value

fix lost first message, #20566

* the first message was sometimes dropped by the InboundHandshake stage
  because it came from unknown origin, i.e. the handshake had not completed
* that happended because the ordinary messagage arrived before the
  first HandshakeReq, which may happen since we sent the HandshakeReq
  over the control stream
* this changes so that HandshakeReq is sent over the same stream, not
  only on the control stream and thereby the HandshakeReq will arrive
  before any other message
* always send HandshakeReq as first message
  * also when the handshake on sender side has been completed at startup
  * moved code from preStart to onPull
2016-05-27 17:05:23 +02:00
Patrik Nordwall
935ab0d82e make use of auto port selection in tests 2016-05-18 09:22:22 +02:00
Patrik Nordwall
8e316d06e9 harden resend sys msg test
* the periodic resend kicked in too early, resending 2 before the Ack(2)
  was delivered
* also improved SystemMessageDelivery stage to not tick periodically
  when there are no messages to deliver (buffer empty)
2016-05-18 08:07:46 +02:00
Patrik Nordwall
d4c086c0ff add quarantining state and inbound quarantine check, #20313
* InboundQuarantineCheck stage sends back Quarantined control
  message if sender system is quarantined
* Ported old RemoteRestartedQuarantinedSpec
* outbound quarantine check and piercing with ActorSelectionMessage
* port of old RemoteQuarantinePiercingSpec and PiercingShouldKeepQuarantineSpec
* quarantine if sys msg buffer overflow
2016-05-18 08:07:46 +02:00
Patrik Nordwall
67325da722 init new handshake for unknown origin, receiver restarted, #20313
* handle UID incarnations, shared association state that can be swapped
  for new handshakes
* detect that message comes from unknown origin and then initiate new
  handshake (handled by InboundHandshake stage)
* simplify the OutboundHandshake stage
  * doesn't have to listen for HandshakeRsp replies, it can just listen
    to when the uniqueRemoteAddress future is completed, InboundHandshake
    stage completes the handshake when it receives HandshakeRsp
  * send the HandshakeReq via the control message ingress, instead of
    pushing it downstreams, than also means that HandshakeReq is only sent
    on the control stream, which is good
* materialization race condition
2016-05-18 08:01:46 +02:00
Patrik Nordwall
64b1007114 add unit tests for the handshake and control stages, #20313 2016-05-12 11:44:22 +02:00
Patrik Nordwall
8a04b6d05a rename reply to control 2016-05-12 08:56:28 +02:00
Patrik Nordwall
16cf8d4ab6 first stab at handshake, #20313
* UID exchange with handshake stages
* second iteration of reply side-channel, observable
* InboundContext and OutboundContext to facilitate testing
  without real transport
* collapse ArterySubsystem and Transport into ArteryTransport
* incomplete HandshakeRestartReceiverSpec (origin address missing
  to be able to implement that part
* remove embedded aeron media driver directory on shutdown
2016-05-11 12:17:37 +02:00
Patrik Nordwall
b93b1a09ab first stab at system message delivery, #20323 2016-05-06 16:49:30 +02:00