Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 11:03
    PiotrJustyna commented #4368
  • 06:58
    dependabot-preview[bot] labeled #4370
  • 06:58

    dependabot-preview[bot] on nuget

    Bump BenchmarkDotNet from 0.12.… (compare)

  • 06:58
    dependabot-preview[bot] opened #4370
  • Apr 06 22:45

    Aaronontheweb on dev

    sharding - release shard lease … (compare)

  • Apr 06 22:45
    Aaronontheweb closed #4369
  • Apr 06 22:45
    Aaronontheweb milestoned #4369
  • Apr 06 22:45
    Aaronontheweb labeled #4369
  • Apr 06 22:45
    Aaronontheweb commented #4363
  • Apr 06 22:31
    yesh-nadella commented #4363
  • Apr 06 22:05
    Arkatufus commented #4368
  • Apr 06 19:55
    zbynek001 opened #4369
  • Apr 06 17:38
    Aaronontheweb assigned #4368
  • Apr 06 17:38
    Aaronontheweb labeled #4368
  • Apr 06 17:37
    Aaronontheweb milestoned #4368
  • Apr 06 17:37
    Aaronontheweb labeled #4368
  • Apr 06 15:07
    PiotrJustyna opened #4368
  • Apr 03 22:24
    huzaifak opened #4367
  • Apr 03 21:45
    Aaronontheweb commented #4344
  • Apr 03 05:55
    Lutando commented #4344
greatmengqi
@greatmengqi
Thank you ,i will have a try
Alex Michel
@amichel
@greatmengqi there's a HOCON extension for VSCode. Only problem is when HOCON is inside app.config and not external file you need to switch between XML and HOCON
Vladimir Boiarkin
@vladmir-boy
Hi. Can anybody tell me what could be a reason of [ERROR][15.09.2019 11:03:56][Thread 0032][[akka://Sample/system/IO-TCP#1838091985]] Swallowing exception during message send
Cause: Hyperion.ValueSerializers.UnsupportedTypeException: No coercion operator is defined between types 'System.Void*' and 'System.Object'.
at Hyperion.ValueSerializers.UnsupportedTypeSerializer.WriteManifest(Stream stream, SerializerSession session)
at Hyperion.Extensions.StreamEx.WriteObject(Stream stream, Object value, Type valueType, ValueSerializer valueSerializer, Boolean preserveObjectReferences, SerializerSession session)
at lambda_method(Closure , Stream , Object , SerializerSession )
at Akka.Serialization.HyperionSerializer.ToBinary(Object obj)
at Akka.Actor.ActorCell.SerializeAndDeserializePayload(Object obj)
at Akka.Actor.ActorCell.SerializeAndDeserialize(Envelope envelope)
at Akka.Actor.ActorCell.SendMessage(Envelope message) ?
Aaron Stannard
@Aaronontheweb
@vladmir-boy that's pretty amazing
never seen that before with Hyperion
mind filing an issue for it?
@Horusiath wait, there is?
@vladmir-boy specifically, I want to see how on earth Hyperion tried to cast an object to a System.Void
that sounds like the sort of thing that would happen in C++ with a reinterpret_cast
Zetanova
@Zetanova
hi, i face most of the time a problem with lazy loaded routers / remoteDeploy that a lazy created router (ConsistentHashingPool and ConsistentHashingGroup) with a role selector are empty shortly after initialization. I can overcome it with a check of GetRoutees and a Stash. But is there a better way to wait until a router got its routees?
Zetanova
@Zetanova
.. its a bug in ClusterRoutingConfig.cs
will try to make a PR
HermansG
@HermansG
In the class Akka.Actor.ReceiveActor there is protected sealed override void OnReceive(object message) which is sealed.
Why? I am looking for a generic possibility to measure the receive of any message. Like it is possible to hook in on Unhandled.
Zetanova
@Zetanova
@HermansG For generic/base stuff use the ArroundReceive
Bartosz Sypytkowski
@Horusiath
@HermansG you can have custom wrap with AroundReceive and for unhandled messages specifically you can override Unhandled as well
Arjen Smits
@Danthar
@HermansG if your interested in measuring message throughput for akka.net you might want to check out https://phobos.petabridge.com/
evaldast
@evaldast

Hello. Trying to use Akka framework for my project. Guess it's a bit more question of an architecture, however, I am dealing with a state change which losses some of the messages due to logic implemented.
Basically it goes like this:
Actor 1 receives messages for user actions -> Actor 1 decides which actor to forward to based on current status of the user -> Actor 2 sums up user actions and send a message to actor 1 to change state if threshold is hit. -> Actor 1 changes state and will now forward actions to Actor 3.

Basically the problem I am dealing with is that the state changes while there are still messages enqueued to Actor 2 which are now supposed to be routed to Actor 3, since the threshold was hit.

How do I approach this problem? I don't want to Ask() for user's state every time I am processing an action

Zetanova
@Zetanova
@evaldast yes its an architecture issue. You can optionaly switch to akka.streams but dont do it if u currently are low on time.
Simple approach would be to just aggregate the actions in Actor1 directly. An other approach would be to also change the behavior of Actor2 after the treshhold tiggered, so Actor2 sends the rest of the user-actions message back to Actor1 or directly to Actor3
evaldast
@evaldast
Thanks for the reply, yes, I was currently using the second approach you mentioned, wondered if there was a better way to go around this
Zetanova
@Zetanova
and second approach has a side effect, you will loose the message ordering. If the aggregate process need a ordered event stream (user-login before logout) then better to make a simple class (no-actor) that handles the event-message and Actor1 creates an instance of it and processes the user-messages with it
userActionsAggregate.Handle(msg);  
if(userActionsAggregate.IsTriggered) {  Become(Triggered); }
evaldast
@evaldast
No, the aggregate does not care about message order, it aggregates the values of events received and once the sum of a value is hit it moves to next step
I would not mind moving with approach 1 where aggregating is done in the same actor which checks for current status, however, there is quite a bit of heavy lifting involved into aggregation process which I would not like to have in a single actor
Zetanova
@Zetanova
How to run Akka.Cluster.Tests.MultiNode test localy? For me every test gets skipped
Inside VS2017
Aaron Stannard
@Aaronontheweb
@Zetanova I need to finish akkadotnet/akka.net#3901
but to run the build in-ones locally
.build.cmd multinodetests
Alex Hofer
@alexhofer

I have two questions, I have a callback for a FIlewatcher that I want to have send a message to Self which would then send a message to a Child. However I am running into an exception about there being no Actor Context because of async await. I was following the File Observer Actor example on GitHub.

Anywho onto the questions, first is there any way to preserve Self in this situation? I tried just putting it in a property on the Actor.

Second, is it frowned upon to store Context in a property so I can use it to create a child in this situation? This is what I ended up doing, so I wanted to make sure it wouldn't cause any terrible issues.

Example of what was broken:

private void FileWatcherOnCreated(object sender, FileSystemEventArgs e)
{
    ProcessFile(e.FullPath);
}

private void ProcessFile(string filePath)
{
    var message = new MyMessage(filePath);
    _self.Tell(message);
}
This is what I ended up with:
private void ProcessFile(string filePath)
{
    var message = new MyMessage(filePath);

    var props = context.DI().Props<MyChildActor>();

    //_context here is set in the constructor of the Actor as a readonly property.
    var child = _context.ActorOf(props, someName);

    child.Tell(message, ActorRefs.NoSender);
}
This seems to work fine
Zetanova
@Zetanova
@Aaronontheweb Is it possible to debug stop / step into with multinode?
Zetanova
@Zetanova
@alexhofer FileWatcherOnCreated Handler is could from outside of ActorSystem to u need to save the IActorRef in a member or scope or state variable.
Context.Self and ActorBase.Self are getting the instance from a ThreadStatic field.
var self = Self; //scope variable
fileWatcher.OnCreated += (sender, e) => { self.Tell(new MyMessage(e.FullPath); };
IActorRef are thread safe and safe to call from everywhere (inside and external code) but properties from ActorContext can only be accessed from the current-thread of the actor process
Alex Hofer
@alexhofer
Hmm even there, inside self it is throwing because it can't access Context.
Aaron Stannard
@Aaronontheweb
@Zetanova if you're launching it from Visual Studio it should be possible - just need to pass in the right commandline arguments
Alex Hofer
@alexhofer
 var context = Context;

_watcher.Created += (sender, e) =>
{

    var message = new MyMessage(filePath);

    var props = context.DI().Props<MyChildActor>();

    var child = context.ActorOf(props, someName);

    child.Tell(message, ActorRefs.NoSender);
};
This worked find though. Is this sorta thing ok to do @Aaronontheweb ? Context is thread safe too right?
Aaron Stannard
@Aaronontheweb
@alexhofer context is technically mutable
especially doing things like calling context.ActorOf
so this could, in a busy system, create some problems
Context, the property, throws because it's not meant to be accessed outside the execution context of an actor
Alex Hofer
@alexhofer
Ah, dang. Do you have any tips for somehow getting a message back to Self from within a Callback?
Aaron Stannard
@Aaronontheweb
and we park the Context inside a ThreadStatic variable
closing over self is perfectly fine
I do that all the time when I'm doing TPL stuff
the way I'd rearchitect that code you included is to have the event handler send a message to self
which, in turn, causes self to create a child and forward the message
etc
does that make sense?
Alex Hofer
@alexhofer
Hmm, its throwing because there's no Actor Context inside there. This is inside a behavior if that matters.
Aaron Stannard
@Aaronontheweb
var self = Self