These are chat archives for akkadotnet/akka.net

27th
Sep 2016
Andrew Young
@ayoung
Sep 27 2016 00:35
Why would you use a Group clustered router over a Pool?
Bartosz Sypytkowski
@Horusiath
Sep 27 2016 05:52
@ayoung you wouldn't. Group routers and pool routers are separate things
Andrew Young
@ayoung
Sep 27 2016 05:54
@Horusiath let me ask in a different way. what situations would you use a Group router and in what situations a Pool router?
Bartosz Sypytkowski
@Horusiath
Sep 27 2016 05:56
you can use group router in situations when you already have some actors, but want a single uniform way to route some particular messages for them. Pool routers can be used in situations, when you want to just parallelize work but don't want to care about details of actor management
Andrew Young
@ayoung
Sep 27 2016 06:00
@Horusiath thanks. another question: i'm starting up my cluster and immediately sending messages to a round robin group router every 1 second. I notice that the first 2-3 messages never make it to the routees. How do I ensure that those messages get through? Or, is there a way to wait for the group router to have X number of routees before sending messages?
Bartosz Sypytkowski
@Horusiath
Sep 27 2016 06:56
@ayoung how many cluster nodes have you established when the first messages are coming through?
I'd guess that there are no routee actors assigned at the beginning
Chris Martin
@trbngr
Sep 27 2016 07:33
Hey fellas. I may be coming back to .NET for a new gig. But I'm coming back fighting for F#. Does everything akka-wise work with the F# API?
Bartosz Sypytkowski
@Horusiath
Sep 27 2016 07:47
@trbngr depends which one ;)
in general some cluster stuff (cluster singleton and cluster sharding) are hardly possible using Akka.FSharp, but works when using Akkling
Chris Martin
@trbngr
Sep 27 2016 08:08
hardly possible as in "don't try it"? ;)
Oh bad ass. I just saw Akkling...very nice
Also great job on the graphQl impl.
Bartosz Sypytkowski
@Horusiath
Sep 27 2016 08:34
thx, once I finish one thing, I'm going to give it a proper welcome page and give some advertisement ;)
Chris Martin
@trbngr
Sep 27 2016 08:35
Nice. I'll try to port my Sangria server to it.
Bartosz Sypytkowski
@Horusiath
Sep 27 2016 08:36
;) Keep in mind, that is is a lot younger project, there are still a lot of moving parts
Chris Martin
@trbngr
Sep 27 2016 08:36
Hey.. so back in Akka.net.....Even after calling cluster.Leave, my seed node throws warnings and errors for ever for the node that left. I thought that calling Leave would take care of it leaving.
Totally understand that ;)
Bartosz Sypytkowski
@Horusiath
Sep 27 2016 08:37
Leaving is not the same as Downing a node - checkout akkadotnet/akka.net#2280
Chris Martin
@trbngr
Sep 27 2016 08:38
Do I need to set auto-down
When the app shuts down, I'm calling Leave wait for a sec, then call Down
Bartosz Sypytkowski
@Horusiath
Sep 27 2016 08:39
at the present moment I would set auto-down anyway, unless you have some custom downing provider
Chris Martin
@trbngr
Sep 27 2016 08:40
So even sys.Terminate() doesn't solve this...
I'll set auto-down and be done with it
Marc Piechura
@marcpiechura
Sep 27 2016 09:49
@trbngr maybe you need to wait a few seconds after the Leave call so that the messages are correctly send to the other nodes before you terminate the process.
I think others had the issue too and solved it this way. But this is only based on some gitter discussions so I could be wrong ;)
Chris Martin
@trbngr
Sep 27 2016 09:50
Thx I'll try tomorrow.
Robert Stiff
@uatec
Sep 27 2016 14:22
hi there
i was having trouble with my cluster sharding, so i put together a stand alone implementation, with documentation of my error, so people can see what i'm doing
here i've tried to use sharding to create an instance of MyActor and send it a message, basically i copied and pasted from the example documentation, but i'm getting absolutely nowhere
Robert Stiff
@uatec
Sep 27 2016 15:11
does my example work for anybody else?
Robert Stiff
@uatec
Sep 27 2016 15:59
don't everybody rush at once :)
Bartosz Sypytkowski
@Horusiath
Sep 27 2016 16:44
@uatec are you using .net core?
Andrew Young
@ayoung
Sep 27 2016 17:00
@Horusiath I have two routees on the cluster group router. The weird thing is that even when I do a router.Ask<Routee>(new GetRoutees()) before I start sending messages to the router it comes back with 2 routees. And yet, those first few messages are lost.
Chris Martin
@trbngr
Sep 27 2016 20:02
When configuring cluster sharding, does my seed node need to configure sharding as well? I was under the impression that I could use a dumb simple Lighthouse instance. But my shard registrations never ACK. I'm thinking I need to configure my seeds nodes differently. Any ideas?
Bartosz Sypytkowski
@Horusiath
Sep 27 2016 20:26

@trbngr

@uatec by default cluster sharding will assume, that every node in the cluster has cluster sharding capability. This includes lighthouse, which is not capable of such thing. You need to set config to limit cluster sharding to nodes having particular role and make sure only correct nodes have that role
something like:
akka.cluster.roles = [ "cluster-sharding" ]
akka.cluster.sharding.role = "cluster-sharding"

@ayoung this is strange - can you set an issue on github (with repro if you can)?
Andrew Young
@ayoung
Sep 27 2016 20:28
yep
Chris Martin
@trbngr
Sep 27 2016 20:30
@Horusiath I have that set correctly
wdspider
@wdspider
Sep 27 2016 20:30
Does cluster sharding only work with one entity? or can you configure it like: EntityA shards using RoleA while EntityB shards using RoleB ?
Bartosz Sypytkowski
@Horusiath
Sep 27 2016 20:31
@wdspider what do you mean by "entity"?
wdspider
@wdspider
Sep 27 2016 20:32
oh... yeah, Actor probably would have been a better word
Bartosz Sypytkowski
@Horusiath
Sep 27 2016 20:32
no, entity is valid term for sharded actors, but sharded actors don't "shard"
I guess you mean, you have shard region A configured with akka.cluster.sharding.role = RoleA, and shard region B with akka.cluster.sharding.role = RoleB, right?
wdspider
@wdspider
Sep 27 2016 20:33
yes
Bartosz Sypytkowski
@Horusiath
Sep 27 2016 20:34
so you have splited your sharding capabilities
you have two sharding regions that have been configured to use different roles, so they won't see each other
wdspider
@wdspider
Sep 27 2016 20:37
well, my cluster has 3 primary roles (functions) with a root actor at the top of each.... I was looking to use the sharding to distribute the ActorA root actors across RoleA nodes, the ActorB root actors across RoleB nodes, and the ActorC root actors across RoleC nodes.
Bartosz Sypytkowski
@Horusiath
Sep 27 2016 20:38
you can use some common role, that all cluster sharding nodes will have in common
wdspider
@wdspider
Sep 27 2016 20:39
which seems to be what the Consistent Hash Router does, but it seemed like cluster sharding also supported creating the actor if its key comes in and it has not been created yet
but, maybe I just don't quite understand the function of the cluster sharding if it's more than just that.
Bartosz Sypytkowski
@Horusiath
Sep 27 2016 20:42

distribute the ActorA root actors across RoleA nodes

Could you precise what that means?

cluster sharding in general is used to route messages to actors identified by some (ShardId, EntityId) pair without worrying how those actors are created or when in the cluster do they reside
Andrew Young
@ayoung
Sep 27 2016 20:46
@Horusiath #2327
wdspider
@wdspider
Sep 27 2016 20:46
One feature is request / response translation... I have a collection of TranslationActors that perform these tasks. Given a key (likely the EntityId you mentioned), the TranslationActor setup to handle the key should receive the message. I'd like to spread these TranslationActor across the cluster on any node that supports the TranslationRole. I would also like to not have to worry (much) about spinning up a new TranslationActor for a key that hasn't been seen for awhile.
Bartosz Sypytkowski
@Horusiath
Sep 27 2016 20:47
@ayoung thanks
@wdspider you know that sharded actors are heavier than normal ones, and sending a message to them is definitely slower?
wdspider
@wdspider
Sep 27 2016 20:48
similarly, another feature is connection management.... where given the key, the correct ConnectionManagerActor is sent the message. The ConnectionManagerActors would reside in the ConnectionManagerRole
no, I couldn't find much cluster sharding docs.... but, admittedly I haven't looked since 1.1.2 came out
Bartosz Sypytkowski
@Horusiath
Sep 27 2016 20:51
not much changed since then ;) I have to fill some of the docs
wdspider
@wdspider
Sep 27 2016 20:54
so, you're saying that if I was going to use cluster sharding..... it would be better to route the message to the shard once and then that actor have the three function actors as children?
as you would only incur the shard overhead 1x rather than 3x ?
Bartosz Sypytkowski
@Horusiath
Sep 27 2016 20:55
in general cluster sharding works the best with statefull actors - so when each actor has its own unique state. From what you're saying you don't need that
what is the TranslationActor key used for?
wdspider
@wdspider
Sep 27 2016 20:57
well, the actors have config state.... so keyA might need a 3 step translation process whereas keyB might need a 6 step translation process.
but, overall, one translation does not impact another
Bartosz Sypytkowski
@Horusiath
Sep 27 2016 20:59
this sounds more like a streaming example
wdspider
@wdspider
Sep 27 2016 21:01
possibly.... as it is a pipeline workflow..... I might need to check those docs out
Bartosz Sypytkowski
@Horusiath
Sep 27 2016 21:02
at least akka-streams are pretty heavily documented: http://getakka.net/docs/#akka-streams
wdspider
@wdspider
Sep 27 2016 21:04
I'll look through them.... thanks :)
Aaron Stannard
@Aaronontheweb
Sep 27 2016 21:54
@/all Unity users looking to use Akka.NET... looks like salvation may be coming your way soon: https://forum.unity3d.com/threads/upgraded-mono-net-in-editor-on-5-5-0b4.433541/
upgrading the Unity runtime to a civilized version of Mono
this is going to be targeting C#6 and .NET 4.6~, which is more or less the current version of Mono
which Akka.NET 1.1.2 and above are already able to run on
Yin Zhang
@melcloud
Sep 27 2016 21:56
@Aaronontheweb Nice. I would also need to find time to upgrade lighthouse to 1.1.2 and wrote a upstart/systemctl unit for running it as a service
Aaron Stannard
@Aaronontheweb
Sep 27 2016 21:56
I have a design in my head for a build script that can automatically upgrade all of my projects and test them for compatibility whenever a new release of Akka.NET comes out
too many ideas and not enough time to implement them
this would be easy to do with a NuGet Feed trigger in TeamCity
Yin Zhang
@melcloud
Sep 27 2016 21:57
@Aaronontheweb That would be really nice. I do notice that, due to version change of wire serialiser, the 1.1.1 cannot associate with 1.1.2 version through akka remote
Aaron Stannard
@Aaronontheweb
Sep 27 2016 21:57
speaking of which, I need to upgrade our built servers to Windows Server 2016 RTM - is that image already available on the ARM marketplace?
shit, really? @melcloud
Yin Zhang
@melcloud
Sep 27 2016 21:58
yeah, I could not associate them.
Let me double check again.
Aaron Stannard
@Aaronontheweb
Sep 27 2016 21:58
due to a change in the wire format?
Yin Zhang
@melcloud
Sep 27 2016 21:59
Not sure. Because there is no code changes in my end, the only differents are akka and wire.
And all exception comes from internal actor
actually, it maybe the new ipv6 thing
Aaron Stannard
@Aaronontheweb
Sep 27 2016 22:01
I swear we're done messing with that
lol
none of the defaults have changed on Windows for that
but they did change on Mono
since Mono 4.4.2 doesn't support IPV6 correctly in several places
Uri class being the worst offender probably
that's all been fixed in Mono 4.6 though
Yin Zhang
@melcloud
Sep 27 2016 22:03
@Aaronontheweb confirmed. It is wire.
2016-09-28 08:01:28.202 +10:00 [Error] "Specified cast is not valid."
System.InvalidCastException: Specified cast is not valid.
   at Akka.Remote.EndpointWriter.PublishAndThrow(Exception reason, LogLevel level)
   at Akka.Remote.EndpointWriter.<SupervisorStrategy>b__20_0(Exception ex)
   at Akka.Actor.LocalOnlyDecider.Decide(Exception cause)
   at Akka.Actor.OneForOneStrategy.Handle(IActorRef child, Exception x)
   at Akka.Actor.SupervisorStrategy.HandleFailure(ActorCell actorCell, IActorRef child, Exception cause, ChildRestartStats stats, IReadOnlyCollection`1 children)
   at Akka.Actor.ActorCell.HandleFailed(Failed f)
   at Akka.Actor.ActorCell.SysMsgInvokeAll(EarliestFirstSystemMessageList messages, Int32 currentState)
2016-09-28 08:01:28.206 +10:00 [Error] Error caught channel ["[::ffff:127.0.0.1]:6000"->"[::ffff:127.0.0.1]:54941"](Id="ChannelId(-526309920)")
System.Net.Sockets.SocketException (0x80004005): The I/O operation has been aborted because of either a thread exit or an application request
   at Helios.Channels.Sockets.SocketChannelAsyncOperation.Validate()
   at Helios.Channels.Sockets.AbstractSocketByteChannel.SocketByteChannelUnsafe.FinishRead(SocketChannelAsyncOperation operation)
2016-09-28 08:01:38.205 +10:00 [Error] "AssociationError [akka.tcp://mondo@localhost:6000] <- akka.tcp://mondo@localhost:5001: Error [Specified cast is not valid.] [   at lambda_method(Closure , Stream , DeserializerSession )
   at Wire.ValueSerializers.ObjectSerializer.ReadValue(Stream stream, DeserializerSession session)
   at Wire.Serializer.Deserialize[T](Stream stream)
   at Akka.Serialization.WireSerializer.FromBinary(Byte[] bytes, Type type)
   at Akka.Serialization.Serialization.Deserialize(Byte[] bytes, Int32 serializerId, String manifest)
   at Akka.Remote.Serialization.MessageContainerSerializer.FromBinary(Byte[] bytes, Type type)
   at Akka.Serialization.Serialization.Deserialize(Byte[] bytes, Int32 serializerId, String manifest)
   at Akka.Remote.MessageSerializer.Deserialize(ActorSystem system, SerializedMessage messageProtocol)
   at Akka.Remote.DefaultMessageDispatcher.Dispatch(IInternalActorRef recipient, Address recipientAddress, SerializedMessage message, IActorRef senderOption)
   at Akka.Remote.EndpointReader.<Reading>b__11_1(InboundPayload inbound)
   at lambda_method(Closure , Object , Action`1 , Action`1 , Action`1 )
   at Akka.Tools.MatchHandler.PartialHandlerArgumentsCapture`4.Handle(T value)
   at Akka.Actor.ReceiveActor.ExecutePartialMessageHandler(Object message, PartialAction`1 partialAction)
   at Akka.Actor.ReceiveActor.OnReceive(Object message)
   at Akka.Actor.UntypedActor.Receive(Object message)
   at Akka.Actor.ActorBase.AroundReceive(Receive receive, Object message)
   at Akka.Actor.ActorCell.ReceiveMessage(Object message)
   at Akka.Actor.ActorCell.Invoke(Envelope envelope)]"
Aaron Stannard
@Aaronontheweb
Sep 27 2016 22:04
sure looks like a wire failure
of some sort
Yin Zhang
@melcloud
Sep 27 2016 22:05
when trying to associate from akka 1.1.1 to akka 1.1.2. 1.1.1 version is using wire 0.0.6, 1.1.2 is using wire 0.8
I probably raise an issue in github