These are chat archives for akkadotnet/akka.net

28th
Aug 2017
Arjen Smits
@Danthar
Aug 28 2017 07:41
We make a distinctions between internal stuff, and the user domain. Akka.Remote uses protobuff to send system messages.
However without having looked at the PR you created
If im reading this correctly. You have assigned your custom protobuff serializer to the system.object
this means that serializer effectively becomes your default serializer. If thats protobuf, then yes you need to specify a descriptor for everything.
If you want to only target your persistence stuff. Then you need to specify a serialization binding for each type you are persisting
There is some work done to make this simpler, thats what the DefaultSerializer setting in the persistence journal/snapshot stuff was for.
@joshgarnett you made a remark that this wasn't working fully before. It could be that we overlooked something. But effectively the implementation of the DefaultSerializer setting depends mostly on the plugin implementation itself. Because thats where the serialization happens.
For the sql plugins that means its split between the sql plugin implementation and the sql.common namespace.
Arjen Smits
@Danthar
Aug 28 2017 07:46
However with your latest PR that brought back the persistencemessageserializer indirection layer. The enforcement of this setting is broken.
Thomas Tomanek
@thomastomanek
Aug 28 2017 08:54
hey all. TestProbe allows me to create actors through it, which made me think the parent for the new actor would be the probe itself, but it doesn't look like that's the case. Can someone confirm that's right?
Arjen Smits
@Danthar
Aug 28 2017 10:15
@thomastomanek you mean with the ActorOf method ? Yes that is correct. The parent will not be the TestProbe instance
The TestProbe is a special case that acts as an extension of the TestKit itself. Thats why it carries the whole ActorOf api along with it. But under the hood its the same as calling Sys.ActorOf
Thomas Tomanek
@thomastomanek
Aug 28 2017 10:21
@Danthar ok thanks for the clarification
Joshua Garnett
@joshgarnett
Aug 28 2017 12:10
@Danthar the System.object setting is still set to newton for my app, though I’ve debated on changing it to some dev/null serializer that just throws exceptions to avoid unexplained behavior
Yeah I know about "Google.Protobuf.IMessage, Google.Protobuf" = proto”. It’s not actually used anywhere though, as nothing in the code base was registering, except for tests. I think the ergonomics of my change improve the usage.
Joshua Garnett
@joshgarnett
Aug 28 2017 12:22
For my current app, and I’ve seen this done in other apps, we just use protobuf instances throughout the codebase rather than having a C#/Scala class that is than translated to protobuf. This is especially handy when our game client sends messages to the server and we can just transparently pass it through a few systems before it lands on the actor that should process it.
Joshua Garnett
@joshgarnett
Aug 28 2017 12:28
    public class DevNullSerializer: Serializer {
        public DevNullSerializer(ExtendedActorSystem system) : base(system) {
            IncludeManifest = true;
        }

        public override byte[] ToBinary(object obj) {
            throw new ArgumentException($"Attempting to use the default serializer for {obj.GetType().FullName}");
        }

        public override object FromBinary(byte[] bytes, Type type) {
            throw new ArgumentException($"Attempting to use the default serializer for {type.FullName}");
        }

        public override bool IncludeManifest { get; }
    }
Now to see how that works :)
Arjen Smits
@Danthar
Aug 28 2017 13:55
This would actually be a nice catch-all for cases where we are missing a serialization binding
Joshua Garnett
@joshgarnett
Aug 28 2017 13:56
I think JVM akka added something like this, let me see if I can try and find the flag they used
akka.actor.allow-java-serialization = off
Arjen Smits
@Danthar
Aug 28 2017 14:00
my spider sense thinks github is going to have an outage again. Its dead-slow for me.
ah yeah we have that setting as well
ah actually no i mean something else
We don't have a setting like that, because it makes no sense for us.
What i was thinking about was this:
akka.actor.serialize-messages
but that has a different function
Joshua Garnett
@joshgarnett
Aug 28 2017 14:03
One other thing I need to create an issue on (I just need to confirm first), the log-config-on-start setting only logs the user config and not the fully squashed akka config, which JVM akka does, it’s more verbose, but gives you a full idea of what the config is.
Yeah, more thinking something like… akka.actor.disable-default-serialization or something like that, that’ll just throw errors on a missing type if no serializer is found
Arjen Smits
@Danthar
Aug 28 2017 14:05
Create an issue on that disable-default-serialization thing. Its something we'd have to discuss doing
Joshua Garnett
@joshgarnett
Aug 28 2017 14:05
ok
Arjen Smits
@Danthar
Aug 28 2017 14:06
the log-config-on-start. Yeah i think thats a known issue. I believe the config is dumped to soon, before the main akka system has initialized. I think one of the core members took a look at this a good while ago. But it wasn't an easy fix or something. Don't remember the details really.
Was quite a long time ago.
Perhaps im remembering it wrong and its really an easy fix :P
Joshua Garnett
@joshgarnett
Aug 28 2017 14:07
k, I’ll scan for a ticket, and create another one if I don’t find it
Arjen Smits
@Danthar
Aug 28 2017 14:07
:+1:
Joshua Garnett
@joshgarnett
Aug 28 2017 14:07
Because that is super helpful for debugging
Especially for companies that might provide commercial support for akka.net ;)
Arjen Smits
@Danthar
Aug 28 2017 14:08
^^
But these kind of issues are really helpfull. Because im sure other users have ran into this. But worked their way around it, but never really reported it.
And most of the times they aren't the type of issues which every 'normal' user runs into.
David Rivera
@mithril52
Aug 28 2017 14:12
Anyone have any insight on using protobuf-net as a custom serializer and getting it to serialize IActorRefs? I've created the serlializer, and it works great for messages that have common types, or types that I've created myself, but I'm not sure what to do with IActorRefs, or it its even possible.
Arjen Smits
@Danthar
Aug 28 2017 14:14
It is possible. We do that ourselves as well. For persistence (although heavily discouraged) and remoting.
Off the top of my mind, im not sure how its handled. But you can look at the code base and check it out.
Joshua Garnett
@joshgarnett
Aug 28 2017 14:57
Ok, that is pretty cool
# reference.conf @ jar:file:/Users/jgarnett/.ivy2/cache/com.typesafe.akka/akka-actor_2.11/jars/akka-actor_2.11-2.4.17.jar!/reference.conf: 132
                    "tail-chopping-pool" : "akka.routing.TailChoppingPool"
They don’t just output the config, they also output the exact reference file that was used to generate it
        # String: 3
        "log-config-on-start" : "on",
Shows the manual change I made to log the config
Aaron Stannard
@Aaronontheweb
Aug 28 2017 16:16
oh cool
that's pretty neat @joshgarnett
Phil Sandler
@philsandler_twitter
Aug 28 2017 17:14
Quick Question: is remote actor deployment still a problem when using DI? (akkadotnet/akka.net#1267)
Joshua Garnett
@joshgarnett
Aug 28 2017 19:14
Just opened up a PR at #3043, which adds a local journal plugin backed by disk. This saves a lot of headaches as memory journal + local snapshot doesn’t play well when you have actors that work together to change state.
Andrew Young
@ayoung
Aug 28 2017 20:35
@Aaronontheweb sorry took so long but here it is. #3044
Arjen Smits
@Danthar
Aug 28 2017 21:07
@philsandler_twitter yes it is
@ayoung that issue deserves a +1 simply for the preperation that went into it.
Phil Sandler
@philsandler_twitter
Aug 28 2017 21:30
ty
Andrew Young
@ayoung
Aug 28 2017 23:11
why must i do Receive<UpstreamServerCreated>(msg => Handler(msg)); but there's no override to just do Receive<UpstreamServerCreated>(Handler);?
Aaron Stannard
@Aaronontheweb
Aug 28 2017 23:14
@ayoung in some cases the C# compiler will allow you to use a method group like that
I'm not clear off the top of my head on that though
in terms of when it will let you do that
and thanks for logging that issue
I'll take a look at it this week after we ship a bunch of updates
looking to get 1.3.1 and our first round of Akka.Persistence plugins updated ASAP
Andrew Young
@ayoung
Aug 28 2017 23:16
yeah if i use a method group it wants me to return a bool.
probably wants a Func is my guess.
but only sometimes :)