=rem #16505: Do not publish AddressTerminated

- also not throw IllegalAssocEx from transport
 - added a test for stashing behavior
(cherry picked from commit b7295a8)
This commit is contained in:
Endre Sándor Varga 2015-02-17 13:40:48 +01:00
parent 7a0345ca0e
commit b3f4012746
4 changed files with 180 additions and 33 deletions

View file

@ -166,6 +166,9 @@ private[remote] object ReliableDeliverySupervisor {
case object AttemptSysMsgRedelivery
final case class GotUid(uid: Int, remoteAddres: Address)
case object IsIdle
case object Idle
def props(
handleOrActive: Option[AkkaProtocolHandle],
localAddress: Address,
@ -272,6 +275,7 @@ private[remote] class ReliableDeliverySupervisor(
resendAll()
writer ! FlushAndStop
context.become(flushWait)
case IsIdle // Do not reply, we will Terminate soon, or send a GotUid
case s: Send
handleSend(s)
case ack: Ack
@ -311,6 +315,7 @@ private[remote] class ReliableDeliverySupervisor(
def gated: Receive = {
case Terminated(_)
context.system.scheduler.scheduleOnce(settings.RetryGateClosedFor, self, Ungate)
case IsIdle sender() ! Idle
case Ungate
if (resendBuffer.nonAcked.nonEmpty || resendBuffer.nacked.nonEmpty) {
// If we talk to a system we have not talked to before (or has given up talking to in the past) stop
@ -335,6 +340,7 @@ private[remote] class ReliableDeliverySupervisor(
}
def idle: Receive = {
case IsIdle sender() ! Idle
case s: Send
writer = createWriter()
// Resending will be triggered by the incoming GotUid message after the connection finished
@ -352,6 +358,7 @@ private[remote] class ReliableDeliverySupervisor(
}
def flushWait: Receive = {
case IsIdle // Do not reply, we will Terminate soon, which will do the inbound connection unstashing
case Terminated(_)
// Clear buffer to prevent sending system messages to dead letters -- at this point we are shutting down
// and don't really know if they were properly delivered or not.