Do not tinker with the 0mq socket for the ConnectionSocketActor on Restart
This commit is contained in:
parent
8163555378
commit
2ee712a8b1
2 changed files with 11 additions and 3 deletions
|
|
@ -50,7 +50,7 @@ private[akka] abstract class Mailbox(val actor: ActorCell, val messageQueue: Mes
|
||||||
* Try to enqueue the message to this queue, or throw an exception.
|
* Try to enqueue the message to this queue, or throw an exception.
|
||||||
*/
|
*/
|
||||||
def enqueue(receiver: ActorRef, msg: Envelope): Unit = messageQueue.enqueue(receiver, msg)
|
def enqueue(receiver: ActorRef, msg: Envelope): Unit = messageQueue.enqueue(receiver, msg)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Try to dequeue the next message from this queue, return null failing that.
|
* Try to dequeue the next message from this queue, return null failing that.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -131,10 +131,18 @@ private[zeromq] class ConcurrentSocketActor(params: Seq[SocketOption]) extends A
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override def preRestart(reason: Throwable, message: Option[Any]) {
|
||||||
|
context.children foreach context.stop //Do not call postStop
|
||||||
|
}
|
||||||
|
|
||||||
|
override def postRestart(reason: Throwable) {} //Do nothing
|
||||||
|
|
||||||
override def postStop {
|
override def postStop {
|
||||||
try {
|
try {
|
||||||
poller.unregister(socket)
|
if (socket != null) {
|
||||||
if (socket != null) socket.close
|
poller.unregister(socket)
|
||||||
|
socket.close
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
notifyListener(Closed)
|
notifyListener(Closed)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue