Solved <https://github.com/playframework/playframework/issues/6990>.

On Friday, February 17, 2017 at 12:45:41 PM UTC-5, Elijah Rippeth wrote:
>
> Hello all,
>
> I have found an interesting race condition that is quite likely due to my 
> design when injecting an adapter which provides a ClusterClient in Play 
> 2.5.x. Because groups don't support well-formatted code, I'll provide links 
> to github gists.
>
> First, my adapters 
> <https://gist.github.com/erip/073ccc2e28090deeccfd474df5f1edd9>. The 
> point of the adapter is to inject a cluster client for use in a controller 
> within my Play application.
>
> Secondly, my relevant controller 
> <https://gist.github.com/erip/ab60aaa944a04b31ad2637183309b94c>. The job 
> of this is to simply send the string "Hello!" to my FooActor, who will in 
> turn respond to `sender` with a "World!" message. I won't include this.
>
> Finally, the part marking my FooActor as the receptionis within the 
> cluster:
>
> ClusterClientReceptionist(fooActorSystem).registerService(fooActor)
> Thread.sleep(5000)
>
>
>
>
> I find that occasionally I'll indeed receive World! from the cluster, 
> which is promising. More often, however, I find that I'll receive a 
> DeadLetters message:
>
> *[INFO] [02/17/2017 12:10:01.859] 
> [PubSubMember-akka.actor.default-dispatcher-18] 
> [akka://PubSubMember/system/receptionist] Message 
> [akka.cluster.client.ClusterReceptionist$Internal$GetContacts$] from 
> Actor[akka.tcp://[email protected]:8888/user/ClusterClient#-482763544
>  
> <http://[email protected]:8888/user/ClusterClient#-482763544>] to 
> Actor[akka://PubSubMember/system/receptionist] was not delivered. [1] dead 
> letters encountered. This logging can be turned off or adjusted with 
> configuration settings 'akka.log-dead-letters' and 
> 'akka.log-dead-letters-during-shutdown'.*
>
> Can someone help me find why what causes the race condition? My initial 
> guess is that there was a lazy injection with guice, so I tried to bind the 
> FooActorAdapter as an eager singleton and it didn't work. I also added a 
> Thread.sleep(5000) after the client is created and this didn't help either.
>
> I've been banging on this for the better part of two weeks and would love 
> to solve this!
>
> Cheers,
> Elijah
>

-- 
>>>>>>>>>>      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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to