On Mon, Mar 21, 2016 at 4:45 PM, <[email protected]> wrote: > Hi Endre, > I think I do have a valid use case. I have a stream which occasionally > fails seriously (maybe 2 times a year) . > Since it has a zip stage I have the option to either handle the Exception > and keep the Zip stage balanced or > just let the exception propagate to the default decider and just restart > the stream. >
But there is no such thing as "restart the stream". The current built-in "supervision" only restarts a single stream processing stage but not the whole graph. There is currently no way to restart a whole graph and it is not a trivial problem to tackle in general. -Endre > The work of the stream is "transactional" so I have no problems with the > current broken state caused by the exception. > > For me restart simplifies my code so I think It is ok?! > > Am Montag, 21. März 2016 10:35:58 UTC+1 schrieb Akka Team: >> >> Hi John, >> >> I am not sure what you hope to achieve there and if that even possible. >> Restarting a graph is more similar to restarting a group of actors not to a >> single actor and it is not that easy to do given the backpressure state >> between the restarted stages must be preserved. Also, while one stage >> fails, other parts of the graph might not and still run concurrently, etc. >> >> -Endre >> >> On Fri, Mar 18, 2016 at 1:34 PM, <[email protected]> wrote: >> >>> This would be the solution I would use: >>> >>> http://pastebin.com/pJVnHqcH >>> >>> I am a little unsure about mat.stop() and the Supervision.stop(). >>> >>> Should the code work? I want to restart on every Exception thrown from >>> any Flow,Source,Sink of the Runnable graph >>> >>> Am Freitag, 18. März 2016 11:28:23 UTC+1 schrieb drewhk: >>>> >>>> Hi, >>>> >>>> There is no such thing at the moment. >>>> >>>> The onComplete on the sink does not guarantee that the whole stream has >>>> actually stopped, it only guarantees that the Sink itself was stopped >>>> (which may or may not imply completion of the whole stream; think of >>>> graphs). >>>> >>>> -Endre >>>> >>>> On Fri, Mar 18, 2016 at 11:25 AM, <[email protected]> wrote: >>>> >>>>> Hi, >>>>> If a graph throws an Exception in any flow I want to restart the >>>>> graph. >>>>> >>>>> Actually I would love to have something like Akka Actors >>>>> OneForOneStrategy(10, Duration.create("1 minute")),,,, >>>>> >>>>> I couldn't find the right hints in the docs. What I am trying right >>>>> now is this pseudo code: >>>>> >>>>> Function<Throwable, Supervision.Directive> decider = exc -> >>>>> Supervision.stop(); >>>>> Sink sink = ....; >>>>> >>>>> RunnableGraph<Future<Integer>> runnableGraph = takeGraph.toMat(sink, >>>>> Keep.right()); >>>>> >>>>> ActorMaterializer mat = >>>>> ActorMaterializer.create(ActorMaterializerSettings.create(system).withSupervisionStrategy(decider), >>>>> system); >>>>> >>>>> runnableGraph.run(mat).onComplete(new OnComplete<Integer>() { >>>>> public void onComplete(Throwable failure, Integer value) { >>>>> ActorMaterializer mat2 = >>>>> ActorMaterializer.create(ActorMaterializerSettings.create(system).withSupervisionStrategy(decider), >>>>> system); >>>>> runnableGraph.run(mat2); >>>>> } >>>>> }, system.dispatcher()); >>>>> >>>>> Obviously the above code would only restart once... >>>>> Anyway is this the right direction? >>>>> Is there an idiomatic way to setup restart of an Runablegraph when a >>>>> Exception happens >>>>> >>>>> Write now I am thinking of creating a Supervision Actor and use it to >>>>> init and restart the Runablegraph >>>>> >>>>> Many Greetings >>>>> John >>>>> >>>>> >>>>> >>>>> -- >>>>> >>>>>>>>>> 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. >>>>> >>>> >>>> -- >>> >>>>>>>>>> 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. >>> >> >> >> >> -- >> Akka Team >> Typesafe - Reactive apps on the JVM >> Blog: letitcrash.com >> Twitter: @akkateam >> > -- > >>>>>>>>>> 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. > -- Akka Team Typesafe - Reactive apps on the JVM Blog: letitcrash.com Twitter: @akkateam -- >>>>>>>>>> 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.
