These are chat archives for akkadotnet/akka.net

10th
Feb 2017
matneyx
@matneyx
Feb 10 2017 00:06
Is there any known way to have an actor start an IWebHost (using IWebHost.Run()) and then report back when the host is running? I'm working on building an integration testing application that will start an instance of our Asp.Net Core application, then run Nightwatch tests agains the localhost. I've got all the pieces working separately, but IWebHost.Run is blocking, as far as I can tell, and I'm kinda stuck.
Sean Gilliam
@sean-gilliam
Feb 10 2017 01:33
@matneyx iirc IWebHost.Start() is the non-blocking version of that call
Damian Reeves
@DamianReeves
Feb 10 2017 15:45
How do you customize the serialization of the Newtonsoft.Json serializer for persistence purposes?
matneyx
@matneyx
Feb 10 2017 16:29
@sean-gilliam Thanks, that's exactly what I needed.
Arsene T. Gandote
@Tochemey
Feb 10 2017 17:59
Hello are we close to the release of Net.Core version?
Maxim Cherednik
@maxcherednik
Feb 10 2017 18:39
hi guys, I was wondering, what would be the right way to fix the situation like this:
let's say there is a node, which for some reason got quarantined by the remote system and somehow I need to restart it. What would be my actions? listen to the specific event and then try to re-init the whole ActorSystem? even though this sound a bit strange - cause the whole thing might be pretty ok, it's just clustering thing which might be broken...
Aaron Stannard
@Aaronontheweb
Feb 10 2017 18:55
ThisActorSystemQuarantined
is the message you're looking for @maxcherednik
that will get published to the EventStream
Maxim Cherednik
@maxcherednik
Feb 10 2017 19:00
yeah, but what should I do?
restart?
Aaron Stannard
@Aaronontheweb
Feb 10 2017 19:00
technically you have to if you get quarantined
so what I've done in the past
is after I declare my ActorSystem
I have an actor who will listen for that event
and if that event comes in
it will call ActorSystem.Terminate
and it will close over the ActorSystem.Settings.Config
to grab the current HOCON configuration of the actor system
and I'll tack on a continuation task
after the Task return by Terminate completes
and that contiunation will recreate the ActorSystem and stuff the newly created system back into the same static class that I used to hold a reference to the original ActorSystem
but truth be told, quarantines should be relatively rare
and I'm convinced that they're happening more often than they should right now
so that's a problem I intend to address soon
Bartosz Sypytkowski
@Horusiath
Feb 10 2017 20:11
@DamianReeves if a persisted backend you're using works with akka serialization model, you need to create a custom interface that will be used as a marker for messages you want to serialize. Then in your config:
akka {
  actor {
    serializers {
      custom = "MyNamespace.MySerializer, MyAssembly"
    }
    serialization-bindings {
      "MyNamespace.IMyMarkerInterface, MyAssembly" = custom
    }
  }
}
akka serialization will recognize if your messages are implementing this interface, and will apply serializer based on that mapping
Damian Reeves
@DamianReeves
Feb 10 2017 20:12
So if I want for example custom JSON serialization of F# DUs I have to create my own Akk Serializer (I can't somehow configure the existing Akka Json serializer)?
Bartosz Sypytkowski
@Horusiath
Feb 10 2017 20:16
I think, you cannot extend exsiting serializer at the moment, however I'm working on a PR that should allow you to use HOCON config to configure your serializers.
Damian Reeves
@DamianReeves
Feb 10 2017 20:16
ok... thanks
Maxim Cherednik
@maxcherednik
Feb 10 2017 20:39
@Aaronontheweb thx. Yeah should happen rarely, but happened to my web node:) without me doing nothing special
Aaron Stannard
@Aaronontheweb
Feb 10 2017 21:04
yeah, that's the issue I want to investigate
I think it has a false positive
Aaron Stannard
@Aaronontheweb
Feb 10 2017 21:10
oh man
I think I just figured out why
lol ugh... let me go check
yeah, ok I think I know what it is
Aaron Stannard
@Aaronontheweb
Feb 10 2017 21:16
I'm assuming the quarantine happens when a node goes unreachable and happens immediately after the first reconnect attempt
does that sound about right @maxcherednik ?
looks like the issue is that the ClusterRemoteWatcher doesn't get a chance to supercede the RemoteWatcher
I'd have to write a test to get to the bottom of that
but it looks like that could happen possibly. Most likely case, just from looking at the code, would be if the node failed immediately when it was joining
before a MemberUp event was published
specifically, an edge case where this event doesn't get a chance to be called https://github.com/akkadotnet/akka.net/blob/dev/src/core/Akka.Cluster/ClusterRemoteWatcher.cs#L158
the code looks more or less the same as it does on the JVM
Aaron Stannard
@Aaronontheweb
Feb 10 2017 21:21
minus some stuff they have for supporting artery, which we aren't adding yet (not touching anything else until .NET Standard support is in-place so we can stop moving the goal posts, plus Artery is still in beta)
so I'm not 100% sure
Aaron Stannard
@Aaronontheweb
Feb 10 2017 21:36
akkadotnet/akka.net#2513 - made an issue