These are chat archives for akkadotnet/akka.net

24th
Jun 2016
feng3245
@feng3245
Jun 24 2016 00:20
Does anyone know a reliable way of distinguishing if an actor is available from an actorSelection. IE no actor is at that address
Aaron Stannard
@Aaronontheweb
Jun 24 2016 00:25
ActorSelection.ResolveOne
is one way - you'll get an exception if the actor can't be resolved
if you want to do it without an exception, do this
ActorSelection.Ask<ActorIdentity>(new Identify(null))
ActorIdentity.Subject will be null
feng3245
@feng3245
Jun 24 2016 00:27
The interesting part is that I've used ResolveOne and it never returned control back to the current thread. Not even with an exception
Aaron Stannard
@Aaronontheweb
Jun 24 2016 00:29
did you specify a timeout on it?
feng3245
@feng3245
Jun 24 2016 00:29
I specified a 3 second timeout
Aaron Stannard
@Aaronontheweb
Jun 24 2016 00:30
should work - our source is open; give it a look
might also be an issue, if you're doing this over Akka.Remote, that we've fixed in 1.1
made a lot of changes related to that
feng3245
@feng3245
Jun 24 2016 00:33
The current release for akka.net is at 1.08 from nuget. Is it out yet?
Aaron Stannard
@Aaronontheweb
Jun 24 2016 00:33
1.1 is due out in a week
timeline is on the readme
feng3245
@feng3245
Jun 24 2016 00:33
Ok good to know
Aaron Stannard
@Aaronontheweb
Jun 24 2016 00:33
although we were originally supposed to ship on June 14
taking longer than expected to wrap up some of the clustering and low-level bits
feng3245
@feng3245
Jun 24 2016 00:38
Happens every cycle where I work. We don't even know what are deadlines anymore lol
Chris Martin
@trbngr
Jun 24 2016 00:48
hey @Aaronontheweb. Is there newer Cassandra plugin? I just upgraded to newest nightlies and it's broken.
Aaron Stannard
@Aaronontheweb
Jun 24 2016 00:49
I believe @cconstantin is working on a new one
Chris Martin
@trbngr
Jun 24 2016 00:49
Well. If 1.1 is coming, maybe it's time for my vacation ;)
Chris Constantin
@cconstantin
Jun 24 2016 01:12
@trbngr new version is pending. waiting to release akka-streams & persistence-query first
Ivan R. Perez
@irperez
Jun 24 2016 03:10

@Aaronontheweb

it's a common problem - so coming up with a canonical solution would be a good idea. I think it's going to be something inherent in the actor on either end of the pub/sub relationship though, rather than a modification of the DistributedPubSub system itself

The problem with this is that the publisher doesn't know who all the subscribers are. So my thinking was that the mediator would ensure the message got through. Also, in my scenario, all subscribers require the message to come through, not just a single subscriber. Can't the acknowledgement protocol be used between the mediator and the subscriber?

feng3245
@feng3245
Jun 24 2016 03:32
Did something happen to the source? I downloaded it and am getting a lot of syntax error regarding $ being used infront of " etc
Bart de Boer
@boekabart
Jun 24 2016 05:24
Try VS2015
$ in front of " is a C#6 feature:
var someValue = DateTimeOffset.Now;
var asString = $"It is now {someValue:HH} o'clock";
Until recently, I never discoverd C# 6 code in akka.net though... is it intentional, @Aaronontheweb ?
Marc Piechura
@marcpiechura
Jun 24 2016 05:53
@boekabart yep, check out the recent streams code, C# 6 everywhere ;)
to11mtm
@to11mtm
Jun 24 2016 14:27
Yeah, I run into that a LOT, kinda sucks cause we are stuck on 2013 =(
HenryTonnison
@HenryTonnison
Jun 24 2016 14:48
Does anyone know how to deserialise type arrays in Akka.net HOCON. I think in Java there is a getConfigList(string path)
some {
    namespace {
        users = [
            {
                name = "firstUser"
                age = 25
            }
            {
                name = "secondUser"
                age = 35
            }
        ]
    }
}
HenryTonnison
@HenryTonnison
Jun 24 2016 15:01
//Something like this
 foreach (Config user in config.GetConfigList("some.namespace.users"))
 {
       var name = user.GetString("name");
       var age = user.GetInt("age");
}
Aaron Stannard
@Aaronontheweb
Jun 24 2016 15:29
@HenryTonnison not offhand, @rogeralsing might know
I'm just the network guy :p
@irperez yeah in that scenario
that makes more sense
the only thing I'd encourage though is you'd need to have some way of dealing with poisoned messages
i.e. 1 subscriber is never coming back
cluster deathwatch is probably a good enough tool for that
if a subscriber is terminated
dump all messages that were scheduled for it
because in a cluster deathwatch scenario, you only get a terminated message if the node is removed
or if the actor is intentionally shutdown
Ivan R. Perez
@irperez
Jun 24 2016 15:33
@Aaronontheweb Ok that sounds good.
Aaron Stannard
@Aaronontheweb
Jun 24 2016 15:33
if a node becomes unreachable (i.e. the network partitions temporarily)
then re-trying delivery is the right thing to do
Ivan R. Perez
@irperez
Jun 24 2016 15:35
@Aaronontheweb What would you call this exactly? Did my naming sound good?
Aaron Stannard
@Aaronontheweb
Jun 24 2016 15:36
given that the mediator is playing a heavier role (i.e. it's probably going to be backed by Akka.Persistence)
I'd probably give that top billing in your title :p
Ivan R. Perez
@irperez
Jun 24 2016 15:36
Thats what I thought.
PersistantDistributedPubSub?
Aaron Stannard
@Aaronontheweb
Jun 24 2016 15:39
ReliableMessageBroker is or something like that
Ivan R. Perez
@irperez
Jun 24 2016 15:39
I like that much better
Stanley Goldman
@StanleyGoldman
Jun 24 2016 15:44
did anyone send a Visualizer screenshot yet?
i'm gonna have to go set this up for myself and see
Ivan R. Perez
@irperez
Jun 24 2016 15:47

@Aaronontheweb

if a subscriber is terminated
dump all messages that were scheduled for it

How would one go about dumping those messages?

Aaron Stannard
@Aaronontheweb
Jun 24 2016 15:48
the mediator is going to need to hold those in some sort of state that resides inside the actor
I'd just dump all of those to dead letters
which you should be able to get access to via Context.System
Aaron Stannard
@Aaronontheweb
Jun 24 2016 17:48
@alexvaluyskiy should be done with my dispatcher changes now
fixed a few pretty nasty bugs inside the dispatcher system that I wouldn't have caught were it not for this
and fixed some performance issues too - that showed up bigtime in the Akka.Streams benchmarks
going to shift gears back to fixing up the routers
that plan I told you about with the model based tests and such
wdspider
@wdspider
Jun 24 2016 18:33

Could someone remind me what I need to change in the remote config to resolve this error?

[Error] Akka.Remote.EndpointWriter: Dropping message [Akka.Actor.ActorSelectionMessage] for non-local recipient [[akka.tcp://Embassy@localhost:4053/]]
 arriving at [akka.tcp://Embassy@localhost:4053] inbound addresses [akka.tcp://EmbassyActorSystem@localhost:4053]

The remote part of my config currently looks like this:

remote {
          helios.tcp {
            transport-class = "Akka.Remote.Transport.Helios.HeliosTcpTransport, Akka.Remote"
            public-hostname = localhost   # this needs to be updated to match deployed to server
            port = 4053
          }
}
Aaron Stannard
@Aaronontheweb
Jun 24 2016 18:36
your actor system names are different
akka.tcp://Embassy@localhost:4053/ vs akka.tcp://EmbassyActorSystem@localhost:4053
just need to make those consistent
wdspider
@wdspider
Jun 24 2016 18:37
ah.... yes. Thanks :)
Ivan R. Perez
@irperez
Jun 24 2016 18:39
@Aaronontheweb I have to say that this issue is common and for someone thats new to Akka, its not obvious that the error message is saying that the actor systems are different. Maybe it should suggest to check that the actor system names are the same?
It happened to me and lost a few hours over it.
wdspider
@wdspider
Jun 24 2016 18:41
idk.... it's helpful that the error message has both urls in it..... just sometimes I miss the obvious difference in it until I show it to someone else ;)
wdspider
@wdspider
Jun 24 2016 18:59
Is there example code somewhere that demonstrates how to delay actor creation and/or initial system start messages until the node has joined the cluster? I thought there was one in the WebCrawler example, but I'm not having any luck finding it.
Aaron Stannard
@Aaronontheweb
Jun 24 2016 19:11
oh my god
damn you resharper
this is why I've had performance issues in this PR
Originally written as
public const bool DebugDispatcher = false; // IMPORTANT: make this a compile-time constant so compiler will elide debug code in production
accidentally got turned into this when I used code cleanup
public static bool DebugDispatcher { get; } = false; // IMPORTANT: make this a compile-time constant so compiler will elide debug code in production
I don't think the compiler will elide that
time for me to double check
Bartosz Sypytkowski
@Horusiath
Jun 24 2016 19:15
@wdspider usually you have some kind of top-level actor for functionality of your choice. You can init it on actor system start and order it to listen to cluster events. Once MemberUp has been triggered (if you need to detect if MemberUp is related to current node, that event contains Member.Address property, which would be equal to Cluster.Get(Context.System).SelfUniqueAddress) and then apply any kind of logic you want to handle in that event: create a child, change behavior and so on.
Aaron Stannard
@Aaronontheweb
Jun 24 2016 19:18
blob
without the code elided
blob
with the code elided
IL view for the win
Bartosz Sypytkowski
@Horusiath
Jun 24 2016 19:21
@wdspider something like this:
Cluster cluster = Cluster.Get(Context.System);
overrride void PreStart() => cluster.Subscribe(Self, ClusterEvent.IMemberEvent);
overrride void PostStop() => cluster.Unsubscribe(Self);

// receive
Receive<ClusterEvent.MemberUp>(up => {
    if(up.Member.Address = cluster.SelfUniqueAddress) { /* current node is up in the cluster *? }
    else { /* other node is up in the cluster */ }
});
wdspider
@wdspider
Jun 24 2016 19:22
Thanks @Horusiath
Aaron Stannard
@Aaronontheweb
Jun 24 2016 19:39
there's also the Cluster.RegisterOnMemberUp delegate
which will do that same thing for you
Aaron Stannard
@Aaronontheweb
Jun 24 2016 19:52
@Silv3rcircl3 I think I've figured out some of the perf number issues with the Akka.Streams benchmarks in #2113
the configuration you had specified in reference.conf for Akka.Streams.TestKit.Tests
akka.test.stream-dispatcher {
  type = Dispatcher
  executor = "fork-join-executor"
  fork-join-executor {
    parallelism-min = 8
    parallelism-max = 8
  }
  mailbox-requirement = "Akka.Dispatch.IUnboundedMessageQueueSemantics"
}
the executor value was not respected before
so this actually ran on the ThreadPool
before
now it runs on a DedicatedThreadPool using a ForkJoinExecutor
and there's a palatable performance difference between the two - and where this really shows up are in some of the IO specs
I ran some profiling on some of the unit tests for these same features of Akka.Streams earlier
and saw that a lot of CPU was being eaten up by the UnfairSemaphore.Wait implementation; I don't know why
either way, I may change this back to using a thread-pool-executor so it can pass its benchmarks again
but just an FYI - took me hours to figure that out
Marc Piechura
@marcpiechura
Jun 24 2016 20:06
Nice catch! If it makes sense you could also use the fork join dispatcher and increase the perf numbers
Aaron Stannard
@Aaronontheweb
Jun 24 2016 20:37
the idea is that the dispatcher type and the executor are now separate
dispatcher is more of a state container for guaranteeing that all scheduled work is completed
and guaranteeing one mailbox run at a time
the executor is what actually runs the work
and you can load a dispatcher or an executor through configuration now
so by accident when I made that change
I switched the executor, unknowingly :p
Marc Piechura
@marcpiechura
Jun 24 2016 20:42
Got it, after you talked about it on the last meeting I already thought that we could adapt this IRunnable interface in the reactive streams TCK because in the jvm version they provide a Executor parameter which I completely removed and call Task.Run instead directly
to11mtm
@to11mtm
Jun 24 2016 20:48
@Aaronontheweb What IL viewing tool is that?
Aaron Stannard
@Aaronontheweb
Jun 24 2016 21:19
@Silv3rcircl3 as yes, you can
we do support that on the Dispatcher directly
and that's what the underlying ExecutorService uses too\
[21:00:26] :     [Step 2/2] --------------- RESULTS: Akka.Streams.Tests.Performance.MaterializationBenchmark+Graph_with_1_imported_flow ---------------
[21:00:26] :     [Step 2/2] Test the performance of the materialization phase for a graph with 1 imported flow
[21:00:26] :     [Step 2/2] --------------- DATA ---------------
[21:00:26] :     [Step 2/2] Elapsed Time: Max: 5.00 ms, Average: 2.33 ms, Min: 1.00 ms, StdDev: 2.31 ms
[21:00:26] :     [Step 2/2] Elapsed Time: Max / s: 1,200.62 ms, Average / s: 1,116.43 ms, Min / s: 1,046.38 ms, StdDev / s: 78.09 ms
[21:00:26] :     [Step 2/2] 
[21:00:26] :     [Step 2/2] --------------- ASSERTIONS ---------------
[21:00:26] :     [Step 2/2] [FAIL] Expected Elapsed Time to must be less than or equal to 2.00 ms; actual value was 2.33 ms.
2ms is pretty tight for a benchmark :p - but I'll see what I can do there
Aaron Stannard
@Aaronontheweb
Jun 24 2016 21:25
I might just need to increase the run count for that one
can't do much if we get burned by the OS
and it schedules for longer or something
could probably solve that issue by averaging it over more runs
other than that I think this PR is just about ready to go
@to11mtm so that's a feature in the newest version of resharper
16 or whatever
Aaron Stannard
@Aaronontheweb
Jun 24 2016 22:25
@alexvaluyskiy hah, just figured out why the ClusterRoundRobin specs weren't passing
translation issue
        def routees = currentRoutees(router2)
        def routeeAddresses = (routees map { case ActorRefRoutee(ref) ⇒ fullAddress(ref) }).toSet
def means these are methods
they were translated into variables
I reviewed the source code and stepped through it while everything was running
Aaron Stannard
@Aaronontheweb
Jun 24 2016 22:30
looked fine to me
then I saw this
it passed!
onto the consistent hash routing specs
also passes across the board now
Aaron Stannard
@Aaronontheweb
Jun 24 2016 22:35
cool, I think we may be ready to pull this in
with this and the dispatcher PR all that's really left is extracting Cluster.Metrics out, in terms of major action items
we know there's still some issues with the vector clock et al, as you've noted
but I'm feeling pretty optimistic!
I also have to do some cleaning up around the disassociation messages
and that stupid helios warning
wherever it's coming from
I didn't end up writing that model based test for ensuring that the clustered routers respond appropriately to domain events
would have been a big pain in the ass due to the amount of stuff I'd have to mock - namely the remote deployments for a pool router
the multi-node tests do an effective job of covering that using the real thing anyway
Aaron Stannard
@Aaronontheweb
Jun 24 2016 23:21
@alexvaluyskiy seeing some regular failures with node churn specs since we merged it
think there's an issue where something that we merged that spec into still resulted in a break?
the CHR MNTR specs also failed this time, but round robin did not. Passed locally
Jordan S. Jones
@jordansjones
Jun 24 2016 23:38
Hey @Aaronontheweb Any chance we can get PDBs with future releases?
Aaron Stannard
@Aaronontheweb
Jun 24 2016 23:38
normally we do push those
I think SymbolSource crashed last time
Jordan S. Jones
@jordansjones
Jun 24 2016 23:39
Ahh.. Cool. Thanks
Aaron Stannard
@Aaronontheweb
Jun 24 2016 23:39
and our build script would have required me to manually push all 24 of those by hand
since it doesn't deal very well with granular failures
actually that might have been a NuGet 3.4.3 issue
which, infamously, broke virtually everyone's CI process out there
because they stripped the default targets for nuget packages and symbol packages out by default
Jordan S. Jones
@jordansjones
Jun 24 2016 23:40
ha. Nice one Nuget.
Aaron Stannard
@Aaronontheweb
Jun 24 2016 23:40
3.4.4, which we're all using now
resolved that