On Thursday, March 6, 2014 11:25:08 PM UTC-10, Björn Antonsson wrote: > > Hi Jim, > > On 7 March 2014 at 06:38:48, Jim Newsham ([email protected] <javascript:>) > wrote: > > > > On Wednesday, March 5, 2014 10:10:41 PM UTC-10, Björn Antonsson wrote: >> >> Hi Jim, >> >> On 6 March 2014 at 07:45:19, Jim Newsham ([email protected]) wrote: >> >> >> >> On Monday, March 3, 2014 4:55:04 PM UTC-10, Jim Newsham wrote: >>> >>> Does Akka provide a means to stop/start the remoting subsystem? >>> >> >> Can anyone confirm whether this is supported in Akka or not? >> >> >> It is not possibe to only shut down the remoting subsystem in Akka and >> keep the ActorSystem running. The remoting transports are internal to the >> RemoteActorRefProvider and you really can’t access them from the outside. >> >> >> >> >> And if not, any suggestions on how we might be able to add this >> functionality? I've spent a bit of time reading the source, however I'm a >> Java developer with not too much experience in Scala. I suspect I should >> be able to add a disconnect functionality by implementing a transport >> adapter, but I don't know how I would get access to the appropriate object >> to initiate the disconnect command. I see how transport adapters are >> layered and pass management commands down the stack, but I haven't found >> where (if at all) user-level code can inject management commands into the >> transport. >> >> >> So I’m still not sure that I understand what you would gain from shutting >> down the communication. The remoting does a lot of things under the hood, >> like failure detection, and will probably try to open up the communication >> again. >> > Here's an analogy: the writers of Socket provide a close() method, > because lacking such mechanism, the only way to close a socket connection > would be via System.exit(), which would be very restrictive. Bringing it > back to Akka, it seems like the only way to shut down remote communication > is to stop the actor system, which to me is restrictive, and also quite > surprising. > > If I implemented a way to shut down the transport, I understand that the > remoting system would continue to attempt to reconnect periodically > according to the configured parameters. My assumption is that this would > be relatively harmless. > > > So what would the purpose be of shutting down the connection be then, if > it is reopened automatically again? > > You also have to be careful how you shut it down, or the remoting might > deem the other system as “dead” and then you have to restart that system to > be able to connect back to the first one. >
Yes, I understand that we will need to take care of the case where the remote side is quarantined. Now that I've thought about it, "suspend" is a better way to describe the capability we desire. We want to suspend() remote communication, which basically causes all associations to be terminated, and all read/write messages to be dropped -- until we resume(). From the remoting system's point of view, while communication is suspended, the remote peers simply appear unreachable. I've just implemented a transport adapter which does this, and (based on some simple testing) it seems to work. Given my level of Scala experience, it was rather challenging for me, so thank you for the reference to FailureInjectorTransportAdapter, which turned out to be extremely useful as an example. As to why, we primarily want to do this during application startup and shutdown because it will make dealing with certain legacy parts of our application a lot easier. It will also be very useful in writing tests which verify actor behavior during and after periods of unreachability. Regards, Jim > B/ > > > > > >> >> There is a transport adapter that we use for testing that can drop >> packets and is controlled from the test code. It could be used as a >> starting point. >> >> >> https://github.com/akka/akka/blob/master/akka-remote/src/main/scala/akka/remote/transport/FailureInjectorTransportAdapter.scala >> > Thanks, I'll look into this. > > Jim > > >> B/ >> >> >> >> >> Thanks! >> Jim >> >> -- >> >>>>>>>>>> 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. >> >> >> >> >> -- >> Björn Antonsson >> Typesafe <http://typesafe.com/> – Reactive Apps on the JVM >> twitter: @bantonsson <http://twitter.com/#!/bantonsson> >> >> -- > >>>>>>>>>> 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] <javascript:>. > To post to this group, send email to [email protected]<javascript:> > . > Visit this group at http://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > > > -- > Björn Antonsson > Typesafe <http://typesafe.com/> – Reactive Apps on the JVM > twitter: @bantonsson <http://twitter.com/#!/bantonsson> > > -- >>>>>>>>>> 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.
