Skip to content

Commit 5b339df

Browse files
committed
Try not to get stopped by death pact before Unregistration is complete
1 parent 7404d65 commit 5b339df

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/core/Akka/IO/TcpConnection.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,7 @@ private Receive WaitingForRegistration(IActorRef commander)
155155
// up to this point we've been watching the commander,
156156
// but since registration is now complete we only need to watch the handler from here on
157157
if (!Equals(register.Handler, commander))
158-
{
159-
Context.Unwatch(commander);
160-
Context.Watch(register.Handler);
161-
}
158+
SignDeathPact(register.Handler); // will unsign death pact with commander automatically
162159

163160
if (_traceLogging) Log.Debug("[{0}] registered as connection handler", register.Handler);
164161

@@ -727,6 +724,7 @@ private void Abort()
727724
protected void StopWith(CloseInformation closeInfo)
728725
{
729726
_closedMessage = closeInfo;
727+
UnsignDeathPact();
730728
Context.Stop(Self);
731729
}
732730

0 commit comments

Comments
 (0)