9 apr 2014 kl. 15:04 skrev Martynas Mickevičius 
<[email protected]>:

> Hi Iain,
> 
> I think the problem could be in your code here:
> 
>   deathReporter ! DeathReportActor.Watch(fated, self, Create(value))
>   context.system.stop(fated)
> 
> Here I can see a race condition. In some cases fated actor can be stopped 
> before Watch message in handled. So DeathReportActor never gets Terminated 
> message.

This is not true: DeathWatch is idempotent in the sense that you will always 
get the Terminated message at your earliest convenience when both of the 
following are true:
context.watch(target) has been called
the `target` actor does not exist

Regards,

Roland

> If I move
> 
>   context.system.stop(fated)
> 
> to DeathReportActor after watch call
> 
>   context.watch(fated)
>   context.system.stop(fated)
> 
> then your test case passes.
> 
> -- 
> Martynas Mickevičius
> Typesafe – Reactive Apps on the JVM
> 
> -- 
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ: 
> >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.



Dr. Roland Kuhn
Akka Tech Lead
Typesafe – Reactive apps on the JVM.
twitter: @rolandkuhn


-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to