by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 10:52
    andersstorhaug commented #4451
  • 10:48
    andersstorhaug edited #4451
  • 10:47
    andersstorhaug edited #4451
  • 10:44
    andersstorhaug opened #4451
  • Jun 03 16:38
    snekbaev commented #4446
  • Jun 03 16:26
    Arkatufus synchronize #4448
  • Jun 03 16:26
    Arkatufus synchronize #4448
  • Jun 03 16:24
    Arkatufus synchronize #4448
  • Jun 03 16:14
    Arkatufus synchronize #4448
  • Jun 03 15:55

    dependabot-preview[bot] on nuget

    (compare)

  • Jun 03 15:55

    dependabot-preview[bot] on dev

    Bump Google.Protobuf from 3.12.… (compare)

  • Jun 03 15:55
    dependabot-preview[bot] closed #4445
  • Jun 03 15:20
    Aaronontheweb labeled #4446
  • Jun 03 15:20
    Aaronontheweb assigned #4446
  • Jun 03 15:20
    Aaronontheweb commented #4446
  • Jun 03 15:18
    Aaronontheweb milestoned #4446
  • Jun 03 15:18
    Aaronontheweb labeled #4446
  • Jun 03 15:18
    Aaronontheweb unlabeled #4446
  • Jun 03 15:18
    Aaronontheweb labeled #4446
  • Jun 03 15:18
    Aaronontheweb commented #4449
Vasily Kirichenko
@vasily-kirichenko
@Horusiath it does not work very well with SelectAsyncUnordered though ;)
Bartosz Sypytkowski
@Horusiath
if you cannot pass control message as part of the stream, you can always add KillSwitch and execute it manually
Vasily Kirichenko
@vasily-kirichenko
but it will kill the stream immediately?
Bartosz Sypytkowski
@Horusiath
yes, but when you tell it to
you know, there's no magic there - you cannot tell stream to stop itself once there are no more messages, because it doesn't understand how to interpret "no more". In event streams you don't have all of them given up front
you can apply some timeout and tell something like "complete this stream, if no message arrived for the last X seconds" (bascially combination of KeepAlive + TakeWhile could do that)
Vasily Kirichenko
@vasily-kirichenko
no, timeout is not an option. OK, a special message works (FSharpResult.Error(obj()) :))
one more question: does ISourceQueueWithComplete.WatchCompletionAsync().Wait() is the same as adding ToMaterialized(Sink.Ignore<...>(), Keep.Both) and Wait() on the Task that Sink.Ignore returns?
I mean, does the former completes when all the messages reached the end of stream, or when the source queue completes?
ah, got it
as I added TakeWhile(x => x.IsOk) at the end of stream, it's safe to WatchCompletionAsync.
Sam13
@Sam13
Is there any documentation about how to improve performance of SQLite persistence for journalling and snapshots? When I trace my application with JetBrains dotTrace I can see that a lot of time is burned in Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader()
Vasily Kirichenko
@vasily-kirichenko
is an idea of storing application settings via akka persistence crazy?
Vasily Kirichenko
@vasily-kirichenko

more concretely:

  1. On start we spawn a singleton persistent actor (Config).
  2. It's state contains a list of ids of persistent actors, each of which stores configuration of a single kind of "worker" (WorkerConfig).
  3. The Config actor spawns an actor for each such configuration, providing ids.
  4. Each WorkerConfig actor loads the config (via persistence) and spawns any required worker actors (via ClusterPoolRouter I think).
  5. Configuration is changed via sending messaged to Config actor.
  6. If configuration changed, Config actor stops/spawn WorkerConfig actors, pass them config changes, they stop/spawn Worker actors.

Does it look too complicated or just not a right job for Persistence (I've never used it before)? One downside of this that I can see is versioning.

Garrard Kitchen
@garrardkitchen
Is this normal behaviour? I have 1 seed and 2 worker nodes. If I restart either of the worker nodes, they register as cluster members with other nodes. However, if I restart the seed node, it does not register as member in other nodes. Surely, split-brain can't happen if there's a concensus?
fliuAtAim
@fliuAtAim
Do you guys mind not retiring your betas? Some people are still using them.
Chandra Sekhar Manginipalli
@leo12chandu
is there a way to replace substring of a hyperion serialized stream of bytes?
Chandra Sekhar Manginipalli
@leo12chandu
I am trying to replace the references to mscorlib and System.Private.CoreLib so it could work against 4.5.1 and Core but by the time it seriaizes it already is in its own encoding version of bytes hence trying to override it in Akka.Serialization.Serializer.ToBinary of my implementation
Ismael Hamed
@ismaelhamed
@Horusiath off the top of your head, pros and cons of using read-only structs instead of classes for actor messages?
Bartosz Sypytkowski
@Horusiath
@ismaelhamed you don't need to think about nulls or accidental mutability ;) But internally akka operates on untyped mailboxes, so every struct will be boxed anyway and allocated (as it may need to travel between threads) and I'm not expecting any significant improvement in akka itself - you could get some in your own code depending on the use case.
Shukhrat Nekbaev
@snekbaev
if I have actor A and it inside does ActorSelection for actor B to send messages, how do I setup the hierarchy for B for testing?
I understand the don't use ActorSelection and pass IActorRef via constructor, but those two hierarchies are quite different and I will have to carry required IActorRefs everywhere and finally pass to the ctor of A, that's a bit of a...
Ismael Hamed
@ismaelhamed
@Horusiath also lack of inheritance? Though I guess you could argue that you don't need/want it in your messages anyway. Thanks, man.
Shukhrat Nekbaev
@snekbaev
@ismaelhamed I used inheritance in some messages, for example for RequestGet which implementation was identical for several target actors. Thus I created an abstract RequestGetBase class. Messages are routed through a parent gateway actor, but children deal with RequestGetBase. Children also have a base class which actually handle that kind of message
Shukhrat Nekbaev
@snekbaev
it seems ActorOfAsTestActorRef is for setting up the hierarchy, however, with ActorSelection, I think I'm running into race condition :)
Shukhrat Nekbaev
@snekbaev
@Horusiath I'm working on my first akka.net test, say, I have a hierarchy and there's an actor on a third depth level that is required (let's call it Target). In the test I'm creating the root actor for that hierarchy using Sys.ActorOf. After that I'm creating an actor ("Source") who is going to send and receive the message from the "Target". Internally "Source" does ActorSelection into "Target". It seems that when I run the test, the "Source" performs the ActorSelection into the actor which doesn't exist yet, thus, message is lost. The way I fixed the test for now is by adding the Task.Delay(1000); before creating the "Source" actor. If there a way to await until "Target" with its entire parent hierarchy is created first?
Shukhrat Nekbaev
@snekbaev
hm, in the aforementioned scenario I changed the variable that holds "Target" IActorRef to be a public static one. Then in the "Source" instead of ActorSelection I used that variable directly via its container type. Was expecting it to contain a value, but it turns out to be null. When I have 1 second delay between actor "Target"'s parent hierarchy and "Source" actor creation, then there's a value, in other words, issue is not about using ActorSelection, but rather race condition for creation of actors. "Source" is being created and sends messages before "Target"'s parent hierarchy is initialized, though in the code I have Sys.ActorOf for "Target" before the "Source"
Bartosz Sypytkowski
@Horusiath
@snekbaev I don't really know what you want to hear here. There are several ways of establishing contact between two actors. From stuff like preinitialization of actors, via publish/subscribe buses to custom actor system extensions.
what's useful in case depends, on what do you actually try to do (since this is not that obvious, as you don't describe what you want to do, only how are you trying to do it)
Shukhrat Nekbaev
@snekbaev
@Horusiath could you please elaborate the "custom actor system extensions". As for what am I trying to do:
imagine two hierarchies, so basically I need to send the message from some level of the second hierarchy to some level of the first hierarchy. As recommendation was to use IActorRef I felt like it will be a bit too much to drag along the required IActorRefs from the first hierarchy into the second via the constructor (so that it will be passed along to the children). That's why I used ActorSelection. Yesterday I ran into the race condition of actor creation: my test actor was created and sent the message before the first hierarchy was created, thus added the artificial delay to the test (hack?) which helped. After looking at that and not really liking the solution I decided to refactor and actually carry the first hierachy IActorRef into the second one via constructors: parent -> child -> child that will use that IActorRef. However, because there are several IActorRefs needs I decided to actually take only their parent IActorRef and pass only it. Inside that parent I receive all the messages and forward to the corresponding child. I decided not to list all possible child messages in the OnReceive's switch, but rather just check against interface. I.e. every child actor's message implements actor specific ISomeActorMessage interface. This way I don't have to clutter the parent's OnReceive. Not sure yet if that's the best practice, it does make the parent smaller, though need to be careful to implement the correct interface for the correct child actor messages.
Bartosz Sypytkowski
@Horusiath
@snekbaev your later design sounds good. So what's the problem?
Shukhrat Nekbaev
@snekbaev
@Horusiath was concerned whether I went too far :) also that I have to carry an actor ref from one hierarchy into sub levels of another, i.e. parent actors are just a pass-through for the reference in that case
Havret
@Havret
Tip of the day: if you save your hocon configuration as *.conf you will get nice systax coloring in Visual Studio. :D
Havret
@Havret
image.png
Peter Shrosbree
@pshrosbree
I see TypedActor is marked as obsolete in Akka 1.3.8. What is the replacement?
image.png
Oh, ignore me. Long day...
:)
Ismael Hamed
@ismaelhamed
@Havret eeeuuuu!
Shukhrat Nekbaev
@snekbaev
say I have some actor X, it receives the message "Msg", does some processing and replies. When it receives it, it puts it into internal dictionary for the correlation purposes, then asks some other actors, collects the information and before replying removes the entry from the dictionary. I'd like to test that during each internal step dictionary is being correctly updated. What would be the proper approach to test this?
Marc Piechura
@marcpiechura
@snekbaev That the actor stores messages in a dictionary should be an implementation detail and as such shouldn’t be tested explicitly, try to find a test case that tests the logic behind it, e.g. if the actor receives the same message twice before the first has been processed, the second one should be ignored or the actor should respond with a special message.
AndreSteenbergen
@AndreSteenbergen
@snekbaev try reading up on Behaviour Driven Development. Your actors are "black boxes" behaving is some manor. You could approach actor testing a lot like BDD, given a set of already processed events, when command x is raised, then you will expect some outcome. Main focus is actors behave like you need on the outside.
Vagif Abilov
@object
I have a question about Petabridge.Cmd. Currently it runs in a Powershell console. Are there plans to expose its functionality as an API so it can be integrated in customised cluster monitoring tools? /cc @Aaronontheweb
Vasily Kirichenko
@vasily-kirichenko
Vasily Kirichenko
@vasily-kirichenko
Is Lighthouse mandatory to be used? What if I just deploy 5 nodes, 2 of which are seeds?
AndreSteenbergen
@AndreSteenbergen
No not mandatory, it's just so you have two well known nodes you can always and easily find
I guess that's where the comes from as well
Check the code, it is a cluster node, without any functional parts, except hosting an akkasystem.
Vasily Kirichenko
@vasily-kirichenko
ok, thanks
Vagif Abilov
@object
@vasily-kirichenko It's not mandatory but we found it convenient for CI process - we always have our Lighthouses running, no need to redeploy them. And other components are updated all the time.
But didn't you experiment with Consul? You can even replace LH with your own discovery tools.