These are chat archives for akkadotnet/akka.net

6th
Mar 2018
Wael Emara
@waelemara
Mar 06 2018 06:27
Hi, I'm trying implement event sourcing using Akka Persistence, I have a scenario where I want to do an operation across two Aggregates ( actors ) ACID is not a requirement so they just need to happen after each other but in a resilient way , do you guys have a pattern for that. Thanks
jalchr
@jalchr
Mar 06 2018 09:39

Any hints why "sometimes" I'm experiencing this ?

2018-03-06 09:30:56,913 [31] INFO  Archive.Api.Startup - ASP.NET application starting ...
2018-03-06 09:31:00,065 [8] INFO  Akka.Event.DummyClassForStringSources - Starting remoting
2018-03-06 09:31:00,190 [27] ERROR Akka.Remote.Transport.DotNetty.TcpTransport - Failed to bind to 0.0.0.0:16666; shutting down DotNetty transport.
System.AggregateException: One or more errors occurred. ---> System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted
   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Bind(EndPoint localEP)
   at DotNetty.Transport.Channels.Sockets.TcpServerSocketChannel.DoBind(EndPoint localAddress)
   at DotNetty.Transport.Channels.AbstractChannel.AbstractUnsafe.BindAsync(EndPoint localAddress)
   --- End of inner exception stack trace ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at DotNetty.Transport.Bootstrapping.AbstractBootstrap`2.<DoBindAsync>d__26.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Akka.Remote.Transport.DotNetty.DotNettyTransport.<NewServer>d__20.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Akka.Remote.Transport.DotNetty.DotNettyTransport.<Listen>d__21.MoveNext()
---> (Inner Exception #0) System.Net.Sockets.SocketException (0x80004005): Only one usage of each socket address (protocol/network address/port) is normally permitted
   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Bind(EndPoint localEP)
   at DotNetty.Transport.Channels.Sockets.TcpServerSocketChannel.DoBind(EndPoint localAddress)
   at DotNetty.Transport.Channels.AbstractChannel.AbstractUnsafe.BindAsync(EndPoint localAddress)<---

2018-03-06 09:31:00,206 [27] ERROR Akka.Event.DummyClassForStringSources - Remoting error: [Startup failed] []
2018-03-06 09:31:00,222 [38] INFO  Akka.Remote.RemoteActorRefProvider+RemotingTerminator - Shutting down remote daemon.
2018-03-06 09:31:00,222 [8] INFO  Akka.Remote.RemoteActorRefProvider+RemotingTerminator - Remote daemon shut down; proceeding with flushing remote transports.
2018-03-06 09:31:00,222 [29] INFO  Akka.Event.DummyClassForStringSources - Remoting shut down
2018-03-06 09:31:00,222 [38] INFO  Akka.Remote.RemoteActorRefProvider+RemotingTerminator - Remoting shut down.
2018-03-06 09:31:00,222 [38] ERROR Akka.Event.DummyClassForStringSources - Remoting system has been terminated abruptly. Attempting to shut down transports

Part of my configuration

 dot-netty.tcp {
                # Maximum frame size: 32 MB
                # maximum-frame-size = 32000000b

                transport-class = "Akka.Remote.Transport.DotNetty.TcpTransport, Akka.Remote"
                applied-adapters = []
                transport-protocol = tcp
                public-hostname = "xxx.xxx.4.3" #internal address
                hostname = "0.0.0.0"
                port = 16666
                tcp-reuse-addr = off
              }
After multiple attempts to start the web application, I had to restart windows to make it work again !
Yes "Disable Overlapped Recycle" is set to True
Notour
@notour
Mar 06 2018 10:22
Hi, i got an issue in serialization with hyperion that seems to not taking care of the attribute IgnoreDataMember -> https://stackoverflow.com/questions/49128437/akka-net-hyperion-ignoringdatamember Any idea ?
Ondrej Pialek
@ondrejpialek
Mar 06 2018 10:56
Do you guys know if I can ASK a distributed pub sub mediator? (I am using a Send message and expecting a reply back...)

Weird thing is that the log shows this:

Message MyMessage from akka://my-system/temp/j to akka://my-system/system/distributedPubSubMediator was not delivered. 4 dead letters encountered.

But I am asking using that Send message, MyMessage is wrapped inside Send... So why is MyMessage being sent to the pubsub when I am actually sending Send? Did it get unwrapped somewhere by using Ask?

AndreSteenbergen
@AndreSteenbergen
Mar 06 2018 11:57
I am reading through the more code examples, in particular the distributed web crawler at https://github.com/petabridge/akkadotnet-code-samples/tree/master/Cluster.WebCrawler Is it me or are the diagrams not in sync with the code. It looks like the download actor and parse actor are replaced by a graph using a download flow. Am I correct?
Joshua Garnett
@joshgarnett
Mar 06 2018 12:52
@waelemara take a look at the Saga pattern for distributed transactions
Marc Piechura
@marcpiechura
Mar 06 2018 13:11
@AndreSteenbergen it’s the diagram ;) @Aaronontheweb has refactored the example based on Akka.Streams
Onur Gumus
@OnurGumus
Mar 06 2018 14:57
Is proto actor really faster than akka.net?
Marc Piechura
@marcpiechura
Mar 06 2018 15:18
yup, not as much as they claim but ~ twice as fast overall. But that’s not surprising, given the limit amount of features it provides and the less weight it has to carry
Aaron Stannard
@Aaronontheweb
Mar 06 2018 15:58
@jalchr is that on Linux or on Windows?
sounds like you're running into one of these akkadotnet/akka.net#3293
akkadotnet/akka.net#2529
TL;DR;, something is still bound that socket
and when we try to rebind, it fails
the behavior for how TCP's "reuse address" feature works is different on Windows and Linux for some reason
@notour I think we submitted a patch around that recently
let me look at that repo real fast for Hyperion
KiransHub
@KiransHub
Mar 06 2018 16:01
Hey @Aaronontheweb, We spoke a while back and you mentioned that Akka.NET has a heartbeat mechanism. Do you have any examples of it's use?
Oh sorry I'll let you deal with this other thing first... my question isn't urgent
Aaron Stannard
@Aaronontheweb
Mar 06 2018 16:01
@KiransHub it's used automatically by Akka.Remote / Akka.Cluster for detecting when another node goes "unreachable"
it's not exposed directly to end-users of Akka.NET
works in the background usually
the place where it shows up most obviously in your day-to-day use of Akka.NET
is when you deathwatch an actor in Akka.Remote
KiransHub
@KiransHub
Mar 06 2018 16:02
Oh.. Is there an event that I can hook into when the heartbeat doesn't work?
Ah
perfect
Aaron Stannard
@Aaronontheweb
Mar 06 2018 16:02
if you're using Akka.Cluster
you'll want to subscribe to the UnreachableMember event
KiransHub
@KiransHub
Mar 06 2018 16:02
Thank you!
Aaron Stannard
@Aaronontheweb
Mar 06 2018 16:03
since the deathwatch stuff in Akka.Cluster keys off of the node leaving the cluster, which is different than a node being unavailable temporarily
happy to help
KiransHub
@KiransHub
Mar 06 2018 16:04
I will look into those topics a little further
Aaron Stannard
@Aaronontheweb
Mar 06 2018 16:04
I feel bad that I've been dipping in and out of the chatroom lately - been doing a lot of business travel all over the place recently. I always try to answer questions in here first thing in the morning when I can though. Genuinely enjoy doing it and it's the easiest way for us to get data on what we should be doing better to help users in terms of features, bugs, and usually documentation.
KiransHub
@KiransHub
Mar 06 2018 16:06
You need to cluster yourself
Aaron Stannard
@Aaronontheweb
Mar 06 2018 16:06
@notour ah sorry, I was thinking of the wrong thing
but it looks like @Horusiath answered your question: https://stackoverflow.com/questions/49128437/akka-net-hyperion-ignoringdatamember
KiransHub
@KiransHub
Mar 06 2018 16:06
So that you can be horizontally scalable.
Aaron Stannard
@Aaronontheweb
Mar 06 2018 16:07
@KiransHub guess that'd be easier than hiring people
lol
KiransHub
@KiransHub
Mar 06 2018 16:08
@Aaronontheweb Tell me about it! I'm looking to hire a junior, I've not been through the process before. I don't know where to start if I'm honest!
Aaron Stannard
@Aaronontheweb
Mar 06 2018 16:09
when it comes to hiring, if you're not hiring someone you've worked with in the past before
then no one knows wtf they're doing
it's a total crapshoot
(not entirely)
I'd argue that like engineering, the best thing to do is get a spec for what this person should be able to do and what their responsibilities are
and then some measurements for whether or not they're successful
and it's important to touch on non-quantitative stuff in the "abilities" part of the spec
like for any engineer I'm going to hire, being able to deal well with ambiguity and accepting that they might be pulled into an urgent customer-facing triage session at any time regardless of their plans is something that they're going to have to accept if they want the job
Ideally, no one including me or the customer wants there to be a gigantic fire that requires pagers going off during the middle of the night
but in the event that it happens, that's the job
Aaron Stannard
@Aaronontheweb
Mar 06 2018 16:15
so if there's a candidate who wants to have a highly structured job where there's not a lot of ambiguity and none of the problems they're working on are all that urgent
they should take a look at my job spec and go "no thanks, not for me"
someone who's been working in a big corporation for a while and is bored working on non-urgent, "forms over data" type problems might see our job posting and think "that's a really exciting change of pace!"
anyway, that's what the purpose of a good "job specification" should do - help you clarify what your own needs are and help potential candidates self-select themselves in or out of consideration
although lots of people who apply for jobs may not be so clear-headed about the process, in which case you probably need to do something like have them go through Wonderlic testing to separate what they say they want vs. what they actually want
KiransHub
@KiransHub
Mar 06 2018 16:18
That is some really sound advice. I hadn't really considered that stuff.
Aaron Stannard
@Aaronontheweb
Mar 06 2018 16:18
KiransHub
@KiransHub
Mar 06 2018 16:19
I've been wrapped up in employment law.
Aaron Stannard
@Aaronontheweb
Mar 06 2018 16:19
I know employment law is much more stringent in Europe than the USA
KiransHub
@KiransHub
Mar 06 2018 16:19
Although I have given some thought into progression paths
Aaron Stannard
@Aaronontheweb
Mar 06 2018 16:19
where everything here is at-will employment
KiransHub
@KiransHub
Mar 06 2018 16:19
yea
Aaron Stannard
@Aaronontheweb
Mar 06 2018 16:19
you can quit or be fired at any time
KiransHub
@KiransHub
Mar 06 2018 16:21
Thank you for your advice. I've added it to my notes and I'll need to extract a list of actions from it to have completed before I start. Thank you
Aaron Stannard
@Aaronontheweb
Mar 06 2018 16:21
you're welcome
hiring is something you nor anyone else will ever master
because our hiring process is based on an astonishingly small amount of incomplete information
"our" being "industry" in general
and it takes actually working together for a sustained period of time to really figure out if the job and the person are the right fit
KiransHub
@KiransHub
Mar 06 2018 16:25
I was thinking to get the person working with me pair programming for about 4 months or so.
Aaron Stannard
@Aaronontheweb
Mar 06 2018 16:25
that'd do it
KiransHub
@KiransHub
Mar 06 2018 16:25
then after that
they need to be at least self sustaining
preferably making money
There aren't many local permanent employees I know that I'd want to hire.
Maybe I could take a look at local meetups or something
and get a feel for people's skills and expectations.
A sort of "market research"
Ondrej Pialek
@ondrejpialek
Mar 06 2018 19:20

Using ddata and for some reason I cannot create a shard proxy on a node that has a different cluster role...

Error while creating actor instance of type Akka.DistributedData.Replicator with 1 args: (Akka.DistributedData.ReplicatorSettings) ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: The cluster node akka.tcp://my-system@localhost:30020 does not have the role backend

Is this supposed to work? I have two nodes, one is in role api and the other in role backend. the backend node has a proper shard region and the api node tries to create a proxy, specifying the entities live on the backend node..

Ondrej Pialek
@ondrejpialek
Mar 06 2018 20:24
Seems like this line: https://github.com/akkadotnet/akka.net/blob/c954b79f55be3ecb7da64a4d18bc071c18a03c64/src/contrib/cluster/Akka.DistributedData/Replicator.cs#L353 requires that the node that creates the proxy to also be in the same role of the entities it wants to communicate with. This seems to be like an explicit requirement here, the persistent approach does not enforce this, I wonder what is the reason for the check here with ddata...
Bartosz Sypytkowski
@Horusiath
Mar 06 2018 20:29
@ondrejpialek have you tried to setup role via akka.cluster.sharding.distributed-data.role = backend?
Ondrej Pialek
@ondrejpialek
Mar 06 2018 20:31
@Horusiath I have not after I read the following line: https://github.com/akkadotnet/akka.net/blob/c954b79f55be3ecb7da64a4d18bc071c18a03c64/src/contrib/cluster/Akka.Cluster.Sharding/ClusterShardingGuardian.cs#L262 It seems that it will always override that role if you provide a different role in the settings of your shard region / proxy.
Bartosz Sypytkowski
@Horusiath
Mar 06 2018 20:32
I must check it, it may be a bug
Ondrej Pialek
@ondrejpialek
Mar 06 2018 20:33
Do you want me to provide a clearer description somewhere, say a GitHub issue?
Bartosz Sypytkowski
@Horusiath
Mar 06 2018 20:34
sure, it's easy to loose track of issues in gitter
github issue tracker is much better place
thanks for help :)
Ondrej Pialek
@ondrejpialek
Mar 06 2018 20:34
sure, will do that then ;)
.. thank you for looking into this :)
jalchr
@jalchr
Mar 06 2018 21:06
Hi @Aaronontheweb ... yes it looks similar to akkadotnet/akka.net#2529
I actually was using the recommended configuration mentioned in that issue.
The troubling issue is that everything works fine for a long period of time ... then things start to collapse.
I wonder if Akka.net startup has a retry mechanism (with a timeout) to wait for the port before throwing ...
This way ... competing for the same port (like what happens when IIS recycles an application) will work in all cases