These are chat archives for akkadotnet/akka.net

24th
Mar 2015
jcwrequests
@jcwrequests
Mar 24 2015 00:51
@Horusiath Got it.
Stefan Sedich
@stefansedich
Mar 24 2015 01:57
When using PipeTo and an exception is raised in the Task is it possible to get that to propogate up to an unhandled actor exception so that it goes to supervision?
Stefan Sedich
@stefansedich
Mar 24 2015 07:30
@Aaronontheweb answered the above for me, it was too late in the day and I was derping a bit.
I do have a question for the group though on how you would handle supervision in this scenario: https://gist.github.com/stefansedich/0c5e1d2ac431eccd9fed
In this scenario say DoStuff failed, I would want to restart the child, but to do that I would need to execute the Start message again to reset the internal state back to a starting point before kicking off again, what are the best ways to achieve this kind of thing?
My current solution is to pass a message to the parent, but I end up implementing my own retry and not taking advantage of the Supervisor strategy.
Roger Johansson
@rogeralsing
Mar 24 2015 07:40
And I assume that Start carries information that is owned by someone else, e.g. the Parent here? so the parent have to be the one passing it?
Stefan Sedich
@stefansedich
Mar 24 2015 07:40
yeah
sorry if the example is a bit shitty :)
the child actually notifies the parent of the change and parent keeps track of state, so it it has to restart parent would need to pass down the current value.
It is a position in a stream basically.
Roger Johansson
@rogeralsing
Mar 24 2015 07:41
The actor logging solves this by passing back a message to the parent notifying that it is ready to work.. so in the ChildActor ctor, you could add a "Parent.Tell(new IAmReadyToStart())" kind of message, or is that what you are already doing?
when parent receives the IAmREadyToWork, it can pass the Start message back to the child
Stefan Sedich
@stefansedich
Mar 24 2015 07:43
yeah that happens, the issue is how does supervision handle when DoWork fails and the parent has to pass a new Start after the child restarts.
Roger Johansson
@rogeralsing
Mar 24 2015 07:44
the child will send a new IAmReadyToWork to the parent.. if you place that in the ctor
as the child actor will be recreated if you use Restart
Stefan Sedich
@stefansedich
Mar 24 2015 07:44
so basically bypass supervision then?
Roger Johansson
@rogeralsing
Mar 24 2015 07:45
no
Stefan Sedich
@stefansedich
Mar 24 2015 07:45
oh right yep sorry
Roger Johansson
@rogeralsing
Mar 24 2015 07:45
the ctor is always called on the restarting actor. so you can place parent notifications in there
Stefan Sedich
@stefansedich
Mar 24 2015 07:46
yeah so the trick is let the child ask for work
never have the parent start it off
Thanks @rogeralsing that works a treat as usual there is a simple solution!
Stefan Sedich
@stefansedich
Mar 24 2015 08:13
final thing on that @rogeralsing to fail the parent if the child terminates do you just watch it and listen to Terminated?
Once that happens I know the child is good and dead and it is time to give up, I would only want this on errors though not normal shutdown.
Raymen Scholten
@raymens
Mar 24 2015 13:23
Does the Scheduler expose a list of scheduled items? Or is there some other way to 'deschedule' a task?
Roger Johansson
@rogeralsing
Mar 24 2015 13:45
In the 0.8 version, you can schedule using a cancellationtoken. You can use that to cancel the task
In the new dev branch, the scheduler returns an ICancellable
Raymen Scholten
@raymens
Mar 24 2015 14:07
Allright, thanks.
Natan Vivo
@nvivo
Mar 24 2015 17:08
I'm getting an error on config loading where double quotes work, but single quotes gives an error. Shouldn't both work the same?
Natan Vivo
@nvivo
Mar 24 2015 17:13

this works:

ConfigurationFactory.ParseString(@"akka { loggers = [""CustomLogger, Assembly""] }")

but this:

ConfigurationFactory.ParseString(@"akka { loggers = ['CustomLogger, Assembly'] }")

fails with "Logger specified in config cannot be found: "'CustomLogger, Assembly".

Roger Johansson
@rogeralsing
Mar 24 2015 17:34
Ill have a look at it, could be a parser bug inside array
Roger Johansson
@rogeralsing
Mar 24 2015 18:53
@nvivo hehe single quotes are not part of neither the json nor hocon spec.. so 'CustomLogger will be parsed as what hocon calls an unquoted string
agree that it would be useful, but I guess we should stick to the specs
Bartosz Sypytkowski
@Horusiath
Mar 24 2015 20:30
when I run persistence tests (all at once) I've got random timeout exceptions all the time. ofc when I try to run them one by one to check, everything is ok
Roger Johansson
@rogeralsing
Mar 24 2015 20:55
I came to think of that turbo button we had back in the 286/386 days :)
What if you run a subset of test? Maybe there are some specific tests that mess things up for others?
Bartosz Sypytkowski
@Horusiath
Mar 24 2015 20:59
any domain subset of Akka.Persistence.Tests also cause this, only when I run them one by one, they pass
Roger Johansson
@rogeralsing
Mar 24 2015 21:01
Even if two by two?
Possibly the threadpool is saturated, but that shouldnt be visible with a few tests at a time
Stefan Sedich
@stefansedich
Mar 24 2015 22:15
should hostname casing matter? If I try use akka.tcp://import@foo:9998/user/foo
and my helios tcp hostname is FOO
the host will drop the message
Natan Vivo
@nvivo
Mar 24 2015 22:55
@rogeralsing, I based that on the HOCON page that states "a JSON superset, that is, all valid JSON should be valid and should result in the same in-memory data that a JSON parser would have produced."
single quotes are not part of json spec?
wow.. that got me
it really isn't. who would have thought? =)
Natan Vivo
@nvivo
Mar 24 2015 23:04
@rogeralsing nevermind. I agree, stick to the specs.
if only we read them... =)
Stefan Sedich
@stefansedich
Mar 24 2015 23:32
that got me too yesterday @nvivo