Carlo Can you please include the rest of the stack trace that follows: at akka.actor.dungeon.ChildrenContainer$NormalChildrenContainer. reserve(ChildrenContainer.scala:130)
I want to see the origin of it and since you have "do something. . .' comments I am not sure if there is some other code that may attempt to create actors. In other words the only way I was able to reproduce this is by attempting to create an Actor with the same name, which brings me to another question. If you remove Patterns.ask(actor, inputMessage...) block all together, do you still see the problem? Cheers Oleg On Wed, Feb 5, 2014 at 7:38 AM, √iktor Ҡlang <[email protected]> wrote: > > > > > > > > On Wed, Feb 5, 2014 at 1:22 PM, ccirim <[email protected]> wrote: > >> >> >> for(String nomeName : listActorName){ >> > > What is a listActorName and what does it contain? > > >> >> final ActorRef actor = getActor(actorName); >> >> Patterns.ask(actor, inputMessage, Conf.sectionTimeout). >> > > What is an inputMessage and how long is a sectionTimeout? > > >> onComplete(new OnComplete<Object>() { >> >> @Override >> public void onComplete(Throwable t, Object result) >> throws Throwable { >> >> if(t != null){ >> do something!.... >> } >> else{ >> do something else!.... >> } >> > > Why does this section need to do an if-check on the "t" for this problem > to manifest? > > >> >> } >> >> }, getContext().dispatcher()); >> >> } >> >> ................ >> >> >> private ActorRef getActor(String actorName) { >> Option<ActorRef> child = getContext().child(actorName); >> if(child.isDefined()) >> return child.get(); >> else >> return >> getContext().actorOf(Props.create(MyServiceActor.class).withRouter(new >> SmallestMailboxRouter(5)), actorName); >> > > Does this require a MyServiceActor for the problem to manifest and what > does a MyServiceActor do? > Does this also require a SmallestMailboxRouter or even a Router at all to > manifest? > > >> } >> >> ........ >> >> ok? >> >> tnx! >> carlo >> >> >> >> >> Il giorno mercoledì 5 febbraio 2014 13:07:15 UTC+1, √ ha scritto: >>> >>> Hi Carlo, >>> >>> Can you reproduce without the SpringExt etc (i.e. is this fully >>> minimized or not)? >>> >>> >>> On Wed, Feb 5, 2014 at 1:00 PM, ccirim <[email protected]> wrote: >>> >>>> OK! >>>> code sample: >>>> .............. >>>> >>>> for(String nomeName : listActorName){ >>>> >>>> final ActorRef actor = getActor(nomeName); >>>> >>>> Patterns.ask(actor, inputMessage, >>>> Conf.sectionTimeout).onComplete(new >>>> OnComplete<Object>() { >>>> >>>> @Override >>>> public void onComplete(Throwable t, Object result) >>>> throws Throwable { >>>> >>>> if(t != null){ >>>> do something!.... >>>> } >>>> else{ >>>> do something else!.... >>>> } >>>> >>>> } >>>> >>>> }, getContext().dispatcher()); >>>> >>>> } >>>> >>>> ................ >>>> >>>> >>>> private ActorRef getActor(String actorName) { >>>> Option<ActorRef> child = getContext().child(actorName); >>>> if(child.isDefined()) >>>> return child.get(); >>>> else >>>> return getContext().actorOf( >>>> SpringExtProvider.get(getContext().system()).props(actorName).withRouter(new >>>> SmallestMailboxRouter(4)), actorName); >>>> } >>>> >>>> ........ >>>> >>>> Ciao >>>> Carlo >>>> >>>> Il giorno mercoledì 5 febbraio 2014 12:03:13 UTC+1, √ ha scritto: >>>>> >>>>> Please minimize the code to reproduce, and what version are you using? >>>>> >>>>> >>>>> On Wed, Feb 5, 2014 at 10:48 AM, ccirim <[email protected]> wrote: >>>>> >>>>>> Hi >>>>>> >>>>>> I have a strange problem when reuse an actor, (the error is random!) >>>>>> This is my scenario: >>>>>> - send 40 async request (messages) to my principal actor. >>>>>> - principal actor send every single request (message) to 10 secondary >>>>>> actors. >>>>>> - secondary actors reply to an assembler actor who collect the >>>>>> results and send the final result. >>>>>> >>>>>> I resuse every time same actor in this way: >>>>>> >>>>>> private ActorRef getActor(String actorName) { >>>>>> Option<ActorRef> child = getContext().child(actorName); >>>>>> if(child.isDefined()) >>>>>> return child.get(); >>>>>> else >>>>>> return getContext().actorOf(SpringExtProvider.get( >>>>>> getContext().system()).props(actorName).withRouter(new >>>>>> SmallestMailboxRouter(4)), actorName); >>>>>> } >>>>>> >>>>>> (this is "like" store actors in map or cache, its correct?!) >>>>>> >>>>>> and this is the error that return to me in random way at execution >>>>>> time: >>>>>> >>>>>> [ERROR] [02/03/2014 18:40:19.248] [OrchestrationApplication-akka >>>>>> .actor.default-dispatcher-2] [akka.dispatch.Dispatcher] actor name [ >>>>>> actorName1] is not unique! >>>>>> >>>>>> * akka.actor.InvalidActorNameException*: actor name [actorName1] is >>>>>> not unique! >>>>>> >>>>>> at akka.actor.dungeon.ChildrenContainer$NormalChildrenContainer. >>>>>> reserve(ChildrenContainer.scala:130) >>>>>> ... >>>>>> >>>>>> [ERROR] [02/03/2014 18:40:19.248] [OrchestrationApplication-akka >>>>>> .actor.default-dispatcher-2] [akka.dispatch.Dispatcher] actor name [ >>>>>> actorName2] is not unique! >>>>>> >>>>>> * akka.actor.InvalidActorNameException*: actor name [actorName2] is >>>>>> not unique! >>>>>> at akka.actor.dungeon.ChildrenContainer$NormalChildrenContainer. >>>>>> reserve(ChildrenContainer.scala:130) >>>>>> >>>>>> ... >>>>>> >>>>>> etc etc... >>>>>> >>>>>> why this error? if the actor is defines (also actor name) why system >>>>>> try to recreate actor? >>>>>> >>>>>> I think that if an actor dead or is stopped also his name is removed >>>>>> of actopr system, or not? >>>>>> >>>>>> ps: >>>>>> >>>>>> my dispatcher is default dispatcher, and I have a 4 core processor >>>>>> (i5) >>>>>> teh default config for dispatcher is: >>>>>> >>>>>> fork-join-executor { >>>>>> parallelism-min = 8 >>>>>> parallelism-factor = 3.0 >>>>>> parallelism-max = 64 >>>>>> } >>>>>> throughput = 10 >>>>>> >>>>>> its correct? >>>>>> >>>>>> >>>>>> tnx! >>>>>> carlo >>>>>> >>>>>> -- >>>>>> >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>> >>>>>>>>>> Check the FAQ: http://akka.io/faq/ >>>>>> >>>>>>>>>> Search the archives: https://groups.google.com/grou >>>>>> p/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/groups/opt_out. >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Cheers, >>>>> √ >>>>> >>>>> * ——————— **Viktor Klang* >>>>> *Chief Architect - **Typesafe <http://www.typesafe.com/>* >>>>> >>>>> Twitter: @viktorklang >>>>> >>>> -- >>>> >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>> >>>>>>>>>> Check the FAQ: http://akka.io/faq/ >>>> >>>>>>>>>> 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/groups/opt_out. >>>> >>> >>> >>> >>> -- >>> Cheers, >>> √ >>> >>> * ——————— **Viktor Klang* >>> *Chief Architect - **Typesafe <http://www.typesafe.com/>* >>> >>> Twitter: @viktorklang >>> >> -- >> >>>>>>>>>> Read the docs: http://akka.io/docs/ >> >>>>>>>>>> Check the FAQ: http://akka.io/faq/ >> >>>>>>>>>> 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/groups/opt_out. >> > > > > -- > Cheers, > √ > > * ——————— **Viktor Klang* > *Chief Architect - **Typesafe <http://www.typesafe.com/>* > > Twitter: @viktorklang > > -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ > >>>>>>>>>> Check the FAQ: http://akka.io/faq/ > >>>>>>>>>> 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/groups/opt_out. > -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: http://akka.io/faq/ >>>>>>>>>> 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/groups/opt_out.
