These are chat archives for akkadotnet/akka.net

5th
Jun 2018
Aaron Stannard
@Aaronontheweb
Jun 05 2018 02:54
@voltcode that documentation around Akka.Persistence.Query, could you point me in that direction?
I'd like to go fix it if the thing says that Akka.Persistence.Query is experimental
as @object pointed out, it's been stable for a while
voltcode
@voltcode
Jun 05 2018 05:34
@Aaronontheweb see https://getakka.net/articles/persistence/persistence-query.html, there's a yellow warning box
voltcode
@voltcode
Jun 05 2018 05:39
That page is very useful, however, it would be nice to have better hint at whether to use Query to materialize and have a read side out of that and when to implement writes to the read side explicitly. So that when reading the first paragraph, I can understand what's in it for me. I would've proposed changes myself if only I had more experience with it - scratching the surface right know while working on a presentation.
Vagif Abilov
@object
Jun 05 2018 06:55
Thanks guys!
AndreSteenbergen
@AndreSteenbergen
Jun 05 2018 09:13
I am having some trouble configuring my seed nodes (lighthouse). When I put the same config for seed nodes in the config hocon files, I get error not beinig able to join seed node, when I start one without telling about the other, and following that I start the other, it magically works. Is that supposed to work like that with a "master seed", or am I doing something wrong here?
v1rusw0rm
@v1rusw0rm
Jun 05 2018 10:41
Can't figure out how to get Source<T, NotUsed> from Source<T, ICancelable>. What I want to do is to Source.Combine two sources: prematerialized queue source with type Source<T, NotUsed> and Source.Tick. Can anybody help?
v1rusw0rm
@v1rusw0rm
Jun 05 2018 11:03
Got it: Source.Tick(...).MapMaterializedValue(_ => NotUsed.Instance);
Bartosz Sypytkowski
@Horusiath
Jun 05 2018 11:39
@v1rusw0rm there are helper methods for that: Source.Tick(...).MapMaterializedValue(Keep.Left);
but unless you want your source to emit ticks infinitely, I wouldn't discard that cancelable ;)
Marc Piechura
@marcpiechura
Jun 05 2018 12:20
@v1rusw0rm s1.CombineMaterialized(tick, Keep.Right) should keep the cancelable
Oh wait, looks like we don’t have a CombineMaterialized :)
We should port that from the jvm
Marc Piechura
@marcpiechura
Jun 05 2018 12:56
@v1rusw0rm if you want to contribute this operator see akkadotnet/akka.net#3484 ;-)
Aaron Stannard
@Aaronontheweb
Jun 05 2018 14:02
@object happy to do it
@/all https://twitter.com/AkkaDotNET/status/1003971698402693121 - everything is live on NuGet as of last night
nathvi
@nathvi
Jun 05 2018 15:17
Is there any tool to visualize the actor tree of an actor system running?
Onur Gumus
@OnurGumus
Jun 05 2018 15:35
@Aaronontheweb akka documentation says that leader election is deterministic and based on the alphabetical order of hostnames, where as akka.net doc says it is completely random.
@OnurGumus definitely not the case
our docs are wrong if they say that
we use the same leader election algo as the JVM
called the "bully" algorithm
depends on having the nodes sorted in a topological order
hostname + port
could you point me to where it says that?
Aaron Stannard
@Aaronontheweb
Jun 05 2018 15:37
lol
welp, I wrote that
and it's wrong
I'll go fix it
Onur Gumus
@OnurGumus
Jun 05 2018 15:38
:)
@Aaronontheweb another thing Akka SeriLog Logger stuck on 1.3.6
Aaron Stannard
@Aaronontheweb
Jun 05 2018 15:38
I need to make some changes to the LoggingAdapter API
to fix some bugs with it
didn't get a chance to do that in 1.3.8
Onur Gumus
@OnurGumus
Jun 05 2018 15:38
ah ok
Aaron Stannard
@Aaronontheweb
Jun 05 2018 15:39
haven't forgotten though
Onur Gumus
@OnurGumus
Jun 05 2018 15:40
Another question, I wonder why by default akka doesn't allow weakly members to be up? I am trying to imagine a scenario that this is beneficial but I cannot. So a node joins before the cluster converges, what can go wrong with it?
Aaron Stannard
@Aaronontheweb
Jun 05 2018 15:41
@nathvi the actor hierarchy command from petabridge.cmd can do a print-out of the actor hierarchy
including for remote nodes
only need to have it installed inside one node in the cluster
@OnurGumus it's because it weakens the default consistency of how the cluster operates
and theoretically, inside a really large cluster
that could have side effects that are difficult to predict at arms' length
Onur Gumus
@OnurGumus
Jun 05 2018 15:42
Can you describe a scenario that things can go wrong ?
Aaron Stannard
@Aaronontheweb
Jun 05 2018 15:42
large being a ~500-1000 node cluster
routing work and state to a weaklyup node that one or more currently unreachable nodes in the cluster have quarantined
which will cause that weakly up node to get kicked out immediately if those unreachable nodes become reachable again
versus the alternative, which is the joining node immediately gets kicked out of the cluster and is never allowed to have that work / state in the first place
that'd be a really rare case
but, not impossible
other reason why WeaklyUp is opt-in is because it was just a new addition to the akka.cluster membership protocol
Onur Gumus
@OnurGumus
Jun 05 2018 15:45
yeah but almost always I turn it on with my clusters usually less than 10 members.
Aaron Stannard
@Aaronontheweb
Jun 05 2018 15:45
and on both the JVM and Akka.NET, we thought it was prudent to give people who had been running Akka.Cluster on their own terms the ability to opt-in to the protocol instead of opting-out
Onur Gumus
@OnurGumus
Jun 05 2018 15:45
I use clusters for only distributed pub sub and failure detection
Aaron Stannard
@Aaronontheweb
Jun 05 2018 15:45
operating from the principle of "least surprise"
also, because WeaklyUp changed the wire format
at the time it was introduced
which meant in order to use it, the entire cluster had to be upgraded first
imho it's pretty safe to use from day 1
we test it pretty regularly
as part of our multi-node test suite
so nothing wrong with that
Onur Gumus
@OnurGumus
Jun 05 2018 15:46
okay I will keep it as default then.
@Aaronontheweb can I whitelist/blacklist leaders ?
I mean I don't want particular nodes to become leaders. Being a leader implies it's configuration takes effect on "things"
Aaron Stannard
@Aaronontheweb
Jun 05 2018 15:49
no
we don't support that
because you'd need to make that configuration consistent across every node in the cluster
Onur Gumus
@OnurGumus
Jun 05 2018 15:49
oh ok. I think it is a legit scenario
Aaron Stannard
@Aaronontheweb
Jun 05 2018 15:50
which... you could just do to make your leader behaviors consistent across the cluster
Onur Gumus
@OnurGumus
Jun 05 2018 15:50
lets say I use autodowning I know it is discouraged but suppose I do that
I can limit the damage if I can prevent some nodes being leaders
in case of a partition the partition with no leaders should stay idle indefinitely
Also another concern is currently any node in the cluster can down any other.
I heard there is some white list for akka remote but I wonder if it applies to clustering
Suppose I want to allow a node to join to the cluster but not trusting it enough. You get my point.
Onur Gumus
@OnurGumus
Jun 05 2018 17:00
When a node becomes unreachable for long time, does it get downed automatic eventually ?
Bartosz Sypytkowski
@Horusiath
Jun 05 2018 17:02
@Aaronontheweb akka jvm already changed weakly-up to be on by default, we just introduced it a bit later
Onur Gumus
@OnurGumus
Jun 05 2018 17:02
ah okay.
Bartosz Sypytkowski
@Horusiath
Jun 05 2018 17:03

@OnurGumus

When a node becomes unreachable for long time, does it get downed automatic eventually ?

Not by default

Onur Gumus
@OnurGumus
Jun 05 2018 17:03
how about quarantine case ?
Bartosz Sypytkowski
@Horusiath
Jun 05 2018 17:03
you need to configure the cluster behavior for it (either using auto-down or one of the split brain resolvers)
Onur Gumus
@OnurGumus
Jun 05 2018 17:03
Do Quarantined nodes stay quarantined indefinitely ?
AndreSteenbergen
@AndreSteenbergen
Jun 05 2018 17:59
Guys, does the cluster/ remoting use json objects anywhere in the system? When load gets around 4.5 in my 4 core machine my webcrawler is complaining about the endpointwriter: " Error [Unable to cast object of type 'Newtonsoft.Json.Linq.JObject' to type 'Newtonsoft.Json.Linq.JValue'.]"; akka://crawler/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2Fcrawler%4010.0.1.6%3A4063-6/endpointWriter#1127074240 The 4063 server is the CrawlService, the service with this error is the TrackingService. I am not using any Json anymore in my application, so my guess is cluster/ remote is using json for something, or am I reading the error wrong? And am I sending malicious json somehow?
Bartosz Sypytkowski
@Horusiath
Jun 05 2018 18:08
@AndreSteenbergen the easiest way to make sure you're not using json.net is to replace default serializer with something like Hyperion
AndreSteenbergen
@AndreSteenbergen
Jun 05 2018 18:09
You mean System.Object
I mean System.Object to use hyperion
Good idea
AndreSteenbergen
@AndreSteenbergen
Jun 05 2018 19:07

Is this a bug? I downloaded the hyperion source and added this code

public override byte[] ToBinary(object obj)
    {
        Console.WriteLine("SERIALIZE HYPERION: " + obj.GetType());
        Console.WriteLine("StackTrace: '{0}'", Environment.StackTrace);

        using (var ms = new MemoryStream())
        {
            _serializer.Serialize(obj, ms);
            return ms.ToArray();
        }
    }

I get this error Stacktrace:

 SERIALIZE HYPERION: System.Object[]

StackTrace: ' at System.Environment.get_StackTrace()
at Akka.Serialization.MsgPack.HyperionSerializer.ToBinary(Object obj) in C:\Projects\DistributedClaxe\Shared\Akka.Serialization.MsgPack\HyperionSerializer.cs:line 106
at Akka.Remote.Serialization.DaemonMsgCreateSerializer.Serialize(Object obj)
at Akka.Remote.Serialization.DaemonMsgCreateSerializer.PropsToProto(Props props)
at Akka.Remote.Serialization.DaemonMsgCreateSerializer.ToBinary(Object obj)
at Akka.Serialization.Serialization.SerializeWithTransportT
at Akka.Remote.MessageSerializer.Serialize(ActorSystem system, Address address, Object message)
at Akka.Remote.EndpointWriter.WriteSend(Send send)
at Akka.Remote.EndpointWriter.<Writing>b__27_0(Send s)
at lambda_method(Closure , Object , Action1 , Action1 , Action1 ) at Akka.Actor.ReceiveActor.ExecutePartialMessageHandler(Object message, PartialAction1 partialAction)
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)
at Akka.Dispatch.Mailbox.ProcessMailbox(Int32 left, Int64 deadlineTicks)
at Akka.Dispatch.Mailbox.ProcessMailbox()
at Akka.Actor.ActorCell.UseThreadContext(Action action)
at Akka.Dispatch.Mailbox.Run()
at Helios.Concurrency.DedicatedThreadPool.PoolWorker.RunThread()
at System.Threading.Thread.ThreadMain_ThreadStart()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)'

Right after this a Disassociation error occurs
AndreSteenbergen
@AndreSteenbergen
Jun 05 2018 19:18
Never mind, printing the object types show me it is a remote actor contructor, with 2 parameters.
AndreSteenbergen
@AndreSteenbergen
Jun 05 2018 20:34
Hummm ok, there are two problems here I guess, one is definitely mine ... :( One is in the serializer I think, I don't get serializer exceptions anymore. I see this message in my logs: SERIALIZE HYPERION: Akka.Actor.Status+Failure
That's the only time I see the hyperion serializer getting used. Is it possible Actor Status messages can't be serialized/ deserialized correctly using JsonConverter?
AndreSteenbergen
@AndreSteenbergen
Jun 05 2018 21:31
Facepalm: download function just checked isFaulted, not isCanceled ....
However, the Jsonconverter is at fault as well. It can't handle Akka.Actor.Status.Failure.
AndreSteenbergen
@AndreSteenbergen
Jun 05 2018 21:37
I hope it's not duplicate (couldn't find an issue) akkadotnet/akka.net#3490
Aaron Stannard
@Aaronontheweb
Jun 05 2018 21:58
@OnurGumus no, quarantine gets pierced after 5 days or immediately if the node restarts
and that's configurable
and WOW! is that a project you worked on?
@Horusiath I'd be up for making a similar change to Akka.NET then
for new users going forward
might be a good thing to introduce in v1.4.0
Sandeep Chandra
@sandeepc24
Jun 05 2018 23:42
we currently have our REST api ASP.NET server behind a load-balancer, is it possible to replace this setup with one asp.net endpoint + akka.net?