These are chat archives for akkadotnet/akka.net

12th
Nov 2015
Esun Kim
@veblush
Nov 12 2015 00:24
@Horusiath @rogeralsing thx. but with my system (Win10, VS2015) non-sequential ordering occurs a lot. I tested it with my two computers and with both akka.net 1.0.4 nuget release and 1.0.5.90-beta myget release. Even for just 10 numbers a receiver reported that 1, 2, 3, 5, 7, 9, 4, 6, 8, 10. I will take a look at network layer of akka.net to see why. :)
Esun Kim
@veblush
Nov 12 2015 02:48
Ok. Finally. What caused out-of-order message in network was NetworkEventLoop of Helios used by Akka.Remote. Helios TcpConnection has two dedicated work threads for processing receive events. But these threads easily go into race condition
Fortunately there is an easy way to prevent this problem in Akka.NET. Following HOCON configuration sets the number of worker thread for TcpConnection 1
akka.remote.helios.tcp.client-socket-worker-pool {
  pool-size-min = 1
  pool-size-factor = 0
  pool-size-max = 1
}
Esun Kim
@veblush
Nov 12 2015 02:55
After setting this configuration, A receiver can get perfect sequential numbers through network.
Roger Johansson
@rogeralsing
Nov 12 2015 07:41
@Aaronontheweb assigning a timestamp to envelopes will trash the throughput for the default pipeline
in JVM the envelopes are classes as they dont have value types, so they can safely do reference checks.. we could ofcourse do that too, but at the cost of increased GC pressure. (which I still beleive is cheaper than reading some clock value). but we need to think this through, how much perf are we willing to sacrifice for the stashing support, or if we should just ban singleton messages from stashes.
Diego Frata
@diegofrata
Nov 12 2015 09:58
Has anyone experienced live locks with the Serilog sink? Whenever one of my actor fails and gets restarted, the sink seems to lock and nothing else gets printed. Not even the exception related to the actor that's restarting. I'm not sure if I'm doing something wrong or not, but if I disable the log and tell Akka.Net to print to the console, I can at least see the restart being printed.
mph911
@mph911
Nov 12 2015 11:19
I am trying to work with FSM actor. However the FSM shall not start until a certain configuraiton has arrived. My feeling is that this should be done via a specific message and not via injecting the data. That would require that the FSM actor starts with a different behavior than it would display after processing the configuration.
My question is now, can that be achieved with Become (...) and doing a simple Receive (...) inwhich im handling only the special message and upon successful reception switch behavior? Or is there a better way?
Maxim Salamatko
@maxim-s
Nov 12 2015 11:37
I think you can do something like that
When(SomeSpecialState,  state =>
    {
        if (state is Foo)
        {
            ....
        }
        if (state is Bar)
        {
            ....
        }
        return state;
    });
or use StartWith method
mph911
@mph911
Nov 12 2015 12:37
@maxim-s That is what I am doing right now. I was simply wondering if there was a more 'akka' way to do it. Cheers anyway! :smile:
Roger Johansson
@rogeralsing
Nov 12 2015 12:41
Personally I tend to use normal actors with just Become instead of FSM, but thats just a matter of taste really. but using Become, you could have named states like Initializing and Initialized
mph911
@mph911
Nov 12 2015 13:02
@rogeralsing Hmm - I thought about that but I have plenty of states and personally I like FSM. But I get your point. But is it possible to combine an FSM with Become - have the FSM change behavior so to say? Or does that spoil the FSM actor in some way?
Aaron Stannard
@Aaronontheweb
Nov 12 2015 18:17
@rogeralsing any update on your log format string and semantic logging stuff? Got asked about it by some users who are interested in using them earlier
@rogeralsing I was thinking more of just having a counter rather than using the MonotonicClock
since the mailboxes are thread-safe
can just ++ it when they create the envelope
Aaron Stannard
@Aaronontheweb
Nov 12 2015 18:22
err, not the mailbox
the actor cell
tell you what - we can try this out once I get NBench done
and actually measure it
pretty close to having a usable version of it
working on all of the crazy reflection stuff now for building a performance test out of a POCO class with some attributes