Skip to content

Commit

Permalink
=rem #3867 Make sure endpointWriter is terminated before ungate
Browse files Browse the repository at this point in the history
* actor name [endpointWriter] is not unique
* The problem was that the test used 100ms until ungate and
  that made it possible for the endpointWriter to not be
  completely terminated (and removed) before Ungate and
  new Send in idle state, which created new endpointWriter
* I could reproduce it with a sleep in EndpointWriter.postStop
* The solution is to start the scheduled Ungate after Terminated
  has been received
  • Loading branch information
patriknw committed Feb 10, 2014
1 parent f1edf78 commit 35b1d68
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions akka-remote/src/main/scala/akka/remote/Endpoint.scala
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,6 @@ private[remote] class ReliableDeliverySupervisor(
remoteAddress, settings.RetryGateClosedFor.toMillis, e.getMessage)
uidConfirmed = false // Need confirmation of UID again
context.become(gated)
context.system.scheduler.scheduleOnce(settings.RetryGateClosedFor, self, Ungate)
context.unwatch(writer)
currentHandle = None
context.parent ! StoppedReading(self)
Stop
Expand Down Expand Up @@ -319,6 +317,8 @@ private[remote] class ReliableDeliverySupervisor(
}

def gated: Receive = {
case Terminated(_)
context.system.scheduler.scheduleOnce(settings.RetryGateClosedFor, self, Ungate)
case Ungate
if (resendBuffer.nonAcked.nonEmpty || resendBuffer.nacked.nonEmpty) {
writer = createWriter()
Expand Down

0 comments on commit 35b1d68

Please sign in to comment.