These are chat archives for akkadotnet/akka.net

4th
Aug 2017
Ricky Blankenaufulland
@ZoolWay
Aug 04 2017 08:19
@Silv3rcircl3 Hm, that would work. In the Task.ContinueWith handler I can dispose stream and materializer without problem. I will have to manually send my stream completed message there too which Sink.ActorRef() has done for me before. Also, it does not send Akka.Actor.Status.Failure on failures, they are just silently ignored as far as I can see. So that approach does not seem suitable.
There must be some kind of after completion callback for Sinks I guess
Vagif Abilov
@object
Aug 04 2017 08:29
Good morning. Question on persistent actors. Persistent actor will alway get RecoveryCompleted message upon the restoration of its state. What if the state restoration is slow and persistent actor receives other messages while its state is being built? Does actor system guarantee that other messages will be played after the actor state is recovered or the actor needs to stash such messages if they expect correct state?
Arjen Smits
@Danthar
Aug 04 2017 09:33
By default, a persistent actor is automatically recovered on start and on restart by replaying journaled messages. New messages sent to a persistent actor during recovery do not interfere with replayed messages. They are cached and received by a persistent actor after recovery phase completes.
Vagif Abilov
@object
Aug 04 2017 10:26
Thank you @Danthar
Vagif Abilov
@object
Aug 04 2017 12:41
I wonder if others experienced problems caused by persistent actors snapshots. We are using MS SQL Server adapter for persistent actors and often see Akka.Persistence.RecoveryTimedOutException with message "Recovery timed out, didn't get snapshot within 30s." They occur no matter if an actor has snapshots. Even if we clean all snapshots for all actors.
We also see Circuit Breaker exceptions from akka.persistence.journal.sql-server ("Circuit Breaker is open; calls are failing fast"). They often come right after the application start.
tstojecki
@tstojecki
Aug 04 2017 13:32
@object really nice talk on akka streams at ndc oslo.... did you publish the sample code anywhere?
Vagif Abilov
@object
Aug 04 2017 13:34
Thank you @tstojecki, you can grab sample code here: https://dl.dropboxusercontent.com/u/8734289/ReactiveTweets-NDC.zip
tstojecki
@tstojecki
Aug 04 2017 13:34
thanks!
Kosta Petan
@kostapetan
Aug 04 2017 13:37
Hey guys, anyone can help me with setting up akka remoting under docker?
basically I have a docker-compose file defining an API service , seed node (worker) and regular node (worker), but so far no success in connecting the nodes between each other
jalchr
@jalchr
Aug 04 2017 13:38
@object Yes I tried persistent actors few days ago and experienced the same issues you got.
Kosta Petan
@kostapetan
Aug 04 2017 13:39
my remote config looks like this
        remote {
            log-remote-lifecycle-events = INFO
            log-received-messages = on

            dot-netty.tcp {
              transport-class = "Akka.Remote.Transport.DotNetty.TcpTransport, Akka.Remote"
                  applied-adapters = []
                  transport-protocol = tcp
              #will be populated with a dynamic host-name at runtime if left uncommented
              #public-hostname = "127.0.0.1"
              hostname = 0.0.0.0
              port = 4053
              maximum-frame-size = 256000b
            }
        }
then, via environment variables, I'm overwriting the ports
Vagif Abilov
@object
Aug 04 2017 13:41
@jalchr we've been using persistent actors for quite some time with some of these issues coming and going, but recently we revised our code to create more persistent actors simultaneously, and it looks like such errors occur much more frequently now.
Maxim Cherednik
@maxcherednik
Aug 04 2017 13:42
@kostapetan but what exactly doesn't work?
jalchr
@jalchr
Aug 04 2017 13:43

@object

I'm trying to use Akka.Persistence with in-memory snapshot for the AtLeastOnceDeliveryReceiveActor. If everything is left with defaults, it works. The actor "stops" receiving any message, if I use the following serialization in my HOCON:

              serializers {
                wire = "Akka.Serialization.WireSerializer, Akka.Serialization.Wire"
              }
              serialization-bindings {
                "System.Object" = wire
              }

I also tried Hyperion, same issue. If I remove this configuration, it works .
Is this a bug or misconfiguration ?
Okay, I just noticed this #2743

Kosta Petan
@kostapetan
Aug 04 2017 13:43
@maxcherednik I have basically two services, an API and a worker which acts as the seed node as well
Maxim Cherednik
@maxcherednik
Aug 04 2017 13:44
I did it once some time ago, and was following this article: https://mukis.de/pages/akka-cluster-with-docker-containers/
there was something tricky with the ips
Kosta Petan
@kostapetan
Aug 04 2017 13:46
exactly, the seed node IP seems unreachable, even though if I exec inside the container, from there I can successfully "netcat" it
Maxim Cherednik
@maxcherednik
Aug 04 2017 13:48
unfortunately that setup is gone. But anyhow the article helped.
Kosta Petan
@kostapetan
Aug 04 2017 13:49
yeah, probably I need to play with the network configuration a bit, I've gone through the reference configuration for remoting, couldn't figure out what I'm doing wrong
Vagif Abilov
@object
Aug 04 2017 13:51
@jalchr we are using similar serialization settings but our snapshots are in the database. It mostly works but often raises exceptions like I posted above.
Arsene T. Gandote
@Tochemey
Aug 04 2017 14:22
Hello geeks, can someone pls show a tutorial on how I can use actors to implement the Sagas pattern because I see it very relevant for the actor model.
Carlos Torrecillas
@CarlosTorrecillas
Aug 04 2017 14:26

Hi guys, quick question I'm not sure about. I have a distributed akka cluster up and running and I can see the lighthouse registering all the nodes. I have successfully published messages to all subscribers for a topic however I'm not able to do an Ask with a publish message. Is it possible to achieve that? I can see the mediator has the Ask method available. The code I use to perform the ask is the following:

`var mediator = DistributedPubSub.Get(Context.System).Mediator;

        var publishMessage = new Publish("my-topic, new Message());

        Logger.Debug($"{Context.Self.Path.Name} publishing request");

        var response = await mediator.Ask<MyResponseMessage>(publishMessage);

        Context.Sender.Tell(response, Self);`
Bartosz Sypytkowski
@Horusiath
Aug 04 2017 15:28
@object what is your data volume? It may be that sqlserver persistence is serving db requests too slow? In that case batching journal should help (see the code here: akkadotnet/Akka.Persistence.SqlServer#56 )
(unfortunatelly I'm going on vacation and it may be that we hit v1.3 before I finish akka.persistence rework)
Vagif Abilov
@object
Aug 04 2017 15:31
Could be, but it sounds strange if it doesn't manage to restore the state within 30 seconds. In the db I am testing it it's 1M+ event journal records and very few snapshots.
Bartosz Sypytkowski
@Horusiath
Aug 04 2017 15:32
I guess, that in your case events and snapshots both share the same ADO.NET pool of connections
Vagif Abilov
@object
Aug 04 2017 15:32
But we found that we were running latest released NuGet packages (from October 2016!), we changed now to use build from latest sour.ce
Thanks for the reference to batching.
Bartosz Sypytkowski
@Horusiath
Aug 04 2017 15:34
if you're building from source, you may as well try to build batching journal ;) It has some extra configuration options, but in terms of persistence format it's drop-in replacement of existing journal (also if you need base class for batching journal, it's here: https://github.com/akkadotnet/akka.net/blob/cd33195b5aad34895f0fb69893bd2074d539201f/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/BatchingSqlJournal.cs )
sorry for that delay, we should push v1.3 already.
Vagif Abilov
@object
Aug 04 2017 15:40
But will batching journal be a part of 1.3?
Bartosz Sypytkowski
@Horusiath
Aug 04 2017 15:51
it already is, but we need sqlserver impl of it as well + it's opt in, not the default
Vagif Abilov
@object
Aug 04 2017 20:48
I was offline for some hours. @Horusiath since you mentioned ADO.NET pool of connections, is it so that our problems may have been caused by exausted connection pool? Especially now that we have refactored large parts of our system (getting rid of consistent hashing btw :-)) and now there are more parallel activities using persistent actors?
So this is something that batching journal can help with, but there's no SQL Server plugin for it right?
Kosta Petan
@kostapetan
Aug 04 2017 21:55
btw guys, managed to get the docker-compose setup to work, which looks something like this [API] -> [SEED WORKER] -> [NODE WORKER], I'll try to document it, someone might find it useful