These are chat archives for akkadotnet/akka.net

17th
Feb 2016
Aaron Stannard
@Aaronontheweb
Feb 17 2016 03:42
I think the AtLeastOnceDeliveryReceiveActor is screwed up
doesn't have the Command<T> and Recover<T> stuff that a PersistentReceiveActor does
the method names are something weird instead
fuck, nevermind
they're there
intellisense threw me off
Aaron Stannard
@Aaronontheweb
Feb 17 2016 04:47
@Horusiath if there's a connection string error in Akka.Persistence and I can't actually connect to my database, do I get an error back?
getting silent no-throws here and I'm not seeing any of my persistent actors transition into receiving behavior
and not seeing any schema get populated - tried this across SQL Server and Sqlite with v1.0.6
my legacy stuff works fine
based on the logs it looks like my AtLeastOnceDeliveryActors get RedeliveryTick and stash any of the commands I send them
but whatever message these actors need to transition into the behavior where they can process commands never comes and I never get an error
verified that my connection strings are valid
can access the db by other means
but it looks almost as though the plugin never really initializes
Aaron Stannard
@Aaronontheweb
Feb 17 2016 04:55
<akka>
    <hocon>
      <![CDATA[
         akka {
            loglevel = DEBUG
            actor.debug {
              # enable function of Actor.loggable(), which is to log any received message
              # at DEBUG level, see the “Testing Actor Systems” section of the Akka
              # Documentation at http://akka.io/docs
              receive = on

              # enable DEBUG logging of all AutoReceiveMessages (Kill, PoisonPill et.c.)
              autoreceive = off

              # enable DEBUG logging of actor lifecycle changes
              lifecycle = on


              # enable DEBUG logging of unhandled messages
              unhandled = on

              # enable WARN logging of misconfigured routers
              router-misconfiguration = off
            }
            persistence{
              journal {
                plugin = "akka.persistence.journal.sqlite"
                sqlite {
                    auto-initialize = on
                    connection-string = "Data Source=D:\\Repositories\\olympus\\AtLeastOnceDeliveryDemo\\AkkaAtLeastOnceDelivery\\AkkaAtLeastOnceDelivery\\Resources\\AtLeastOnce.db;Version=3;"
                }
              } 
              snapshot-store{
                plugin = "akka.persistence.snapshot-store.sqlite"
                sqlite {
                    auto-initialize = on
                    connection-string = "Data Source=D:\\Repositories\\olympus\\AtLeastOnceDeliveryDemo\\AkkaAtLeastOnceDelivery\\AkkaAtLeastOnceDelivery\\Resources\\AtLeastOnce.db;Version=3;"
                }
              }
            } 
          }
      ]]>
    </hocon>
  </akka>
the plugin was not initializing, manually made this call in C# to force it
var sqliteExtension = SqlitePersistence.Get(actorSystem);
now I can see the schema in my SQLite db
but I'm still not seeing any of my persistent actors finish recovering
weird especially since there's nothing to recover
Aaron Stannard
@Aaronontheweb
Feb 17 2016 05:01
oh holy crap I figured it out
man, this is playing with fire
on my persistent actor. Before
protected override void PreStart()
        {
            _recurringMessageSend = Context.System.Scheduler.ScheduleTellRepeatedlyCancelable(TimeSpan.FromSeconds(1),
                TimeSpan.FromSeconds(1), Self, new DoSend(), Self);
        }
After
protected override void PreStart()
        {
            _recurringMessageSend = Context.System.Scheduler.ScheduleTellRepeatedlyCancelable(TimeSpan.FromSeconds(1),
                TimeSpan.FromSeconds(1), Self, new DoSend(), Self);

            base.PreStart(); // actor never begins recovery process without this
        }
Chris Martin
@trbngr
Feb 17 2016 05:02
That's bitten me before @Aaronontheweb. Glad you found it early. It took me like a day before ;)
Aaron Stannard
@Aaronontheweb
Feb 17 2016 05:03
man, I don't know how I feel about being able to turn that off
lol
I guess it makes sense though, kind of like being able to disable the ability to kill children
although I don't see a practical reason for turning it off though\
Chris Martin
@trbngr
Feb 17 2016 05:04
Would like to see someting like AroundPreStart to avoid it
Yin Zhang
@melcloud
Feb 17 2016 05:27
hi guys, we don't have IEventAdapter in 1.0.4 version of Akka.persistence? Is it a new feature in 1.0.6?
Yin Zhang
@melcloud
Feb 17 2016 06:24
Hi guys, also a design question. Suppose I have a system publishes event called quoteCreated, and a consumer takes that event and does some magic process. Now we decided consumer of quoteCreated needs to wait for a UserApproved event before processing. This can be easily done for all new events. We can also publish a UserApproved for each of the old event during its recovery, but how we can do that? Is it the job for event adapter? Do I need to copy the QuoteCreated to a different namespace to indicate its a new version (although structure hasn't changed)?
Bartosz Sypytkowski
@Horusiath
Feb 17 2016 07:01
@Aaronontheweb @trbngr this is a part of Akka.Persistence upgrade - initial Recovery message will be available as property and it will be send automatically in AroundPreStart
@melcloud IEventAdapter has been added somwhere in 1.0.5-1.06 . When it comes to your problem, you need to differentiate somehow the QuoteCreated event stored with older logic, from the new one. Currently setting up logic based on relations between events is hard - so if you'd like to make UserApproved event emitted as intersperse between quote created, but only if it's not already there... this won't be easy, especially that you're not loading all events from the database when using snapshots, so you may accidentally miss one.
Bartosz Sypytkowski
@Horusiath
Feb 17 2016 07:08
So yeah, custom event adapter is ideal here, as it's able to emit more than one event as result.
Bartosz Sypytkowski
@Horusiath
Feb 17 2016 07:15

@melcloud I think that you could simply add optional QuoteCreated.NeedsUserApproval boolean property - with version tolerant event serializer it should be evaluated to false - then event adapter could just check false on that flag and emit automatic UserApproved for all older events. You don't need to create full new version of an event.

It's up to you how you will diff old and new QuoteCreated, but remember that event adapter can work in both directions. So it can modify not only events coming out from journal, but also these coming in.

Yin Zhang
@melcloud
Feb 17 2016 08:35
@Horusiath Sounds reasonable. Really appreciated. :+1:
JA Reyes
@jarDotNet
Feb 17 2016 09:10
Hi there.
Should be possible to define messages with F# and Actors code with C#?
Jérémie Chassaing
@thinkbeforecoding
Feb 17 2016 09:26
@jarDotNet You definitly can. Using records you have a terse syntax + structural equality, and they're easy to use in C#. Maybe add the [<CliMutable>] attribute for serialization.
Personnaly I use a FsPickler serialization for F# messages so I can use discriminated unions, options and list without any problem.
Jérémie Chassaing
@thinkbeforecoding
Feb 17 2016 09:33
I have a question regarding Akka.Remoting configuration... All example use only localhost as host, but once you want to deploy on serveral servers, you have to use something else..
Yin Zhang
@melcloud
Feb 17 2016 09:34
@thinkbeforecoding so just change to host name or ip of your machine :question:
Jérémie Chassaing
@thinkbeforecoding
Feb 17 2016 09:34
For Lighthouse it's no problem to have a specific config on each server since it's almost never changed. But for other services that join the cluster, having a different config is a problem for deployment.
Maybe I should just set it in code... or is there a way to indicate to use the machine name in the config (without specifying machine name explicity) ?
Yin Zhang
@melcloud
Feb 17 2016 09:39
@thinkbeforecoding I think set in the code is fine. But believe you should set host name or ip during deployment to that server? Your server host name and ip shouldn't be constantly changing
Jérémie Chassaing
@thinkbeforecoding
Feb 17 2016 09:46
Sure, but with automated deployment I don't wan't to have to change config manually for each box, config is overwritton on each deployment.
JA Reyes
@jarDotNet
Feb 17 2016 09:59
Thanks @thinkbeforecoding. We are newbie with akka and even more with F#, so it would be great some advice or sample about how to perform this mix. But we'll play a little bit about this...
Yin Zhang
@melcloud
Feb 17 2016 10:07
@thinkbeforecoding can you transform the config through shell script? Like replace {{}} with something meaningful? It almost goes to the config template way, like what TOML etcd does
Jérémie Chassaing
@thinkbeforecoding
Feb 17 2016 11:52
@jarDotNet using F# for your actor code will give even more clarity !
JA Reyes
@jarDotNet
Feb 17 2016 11:57
Yes, I know @thinkbeforecoding . But it would be a little bit tricky to do that now at our company.
Just simplifying immutability now, I'll be satisfied.
Stephen Newman
@goodisontoffee
Feb 17 2016 12:56

Hi all, I am investigating using Akka.net in a new project, do you have a more up-to-date expectation as to when v1.1 (Clustering) and v1.2 (Persistence) will drop out at this stage? I have found https://petabridge.com/blog/akkadotnet-2015-roadmap/ but wondered if there was anything more up to date?

Cheers :)

Roger Johansson
@rogeralsing
Feb 17 2016 13:06
@goodisontoffee not really, estimates in the opensource world is somewhat flaky as its mostly free time contributions
@thinkbeforecoding nice to see you in here :)
Stephen Newman
@goodisontoffee
Feb 17 2016 13:11
@rogeralsing fair enough - hopefully once I am a bit more up to speed I can contribute myself :)
alexgoeman
@alexgoeman
Feb 17 2016 13:59
Hi where can I download the code for Akka.Persistence.Sql.Common ? (Cannot find it in https://github.com/akkadotnet...) But there is a nuget package .
alexgoeman
@alexgoeman
Feb 17 2016 14:22
@bruinbrown : super, Thx
ibrahim dursun
@idursun
Feb 17 2016 15:40
Hi, I am playing with clustering. I have two nodes with different roles, one of them being the seed node. I also have a consisten-hash-group, and when i ask for routees, I get one routee, which is expected. I start another instance of the worker node and ask for routees and i still get one routee. Is this normal behaviour? if so, how can i get router to be updated with the new cluster members?
tstojecki
@tstojecki
Feb 17 2016 15:43

in akka io, every so often i get this exception

"Only one usage of each socket address (protocol/network address/port) is normally permitted"

which i believe happens in response to Tcp.Bind() call. I am currently not getting a whole lot more information other than Stopped and then Terminated on /system/IO-TCP/selectors/$b/0 right after this.

Can anyone clue me on what that might be caused by and how to recover from this? Is there a message/event I can receive that would let me do that?

Marc Piechura
@marcpiechura
Feb 17 2016 15:50
@tstojecki haven't seen this exception before but there is a CommandFailed message that is send to the handler, maybe the exception inside has more useful information
tstojecki
@tstojecki
Feb 17 2016 15:53
I do have a listener set up for that and it is not getting in there as far as i can tell
Marc Piechura
@marcpiechura
Feb 17 2016 15:55
Mh strange,
Then I don't know either :(
tstojecki
@tstojecki
Feb 17 2016 15:57
i am starting to wonder if Unbind message could possibly help with this?
Marc Piechura
@marcpiechura
Feb 17 2016 16:01
I mean the message indicates that someone else is using this port already, so you need to find out who is listing on that port.
Or do you bind multiple times to the same port?
tstojecki
@tstojecki
Feb 17 2016 16:03
the scenario is that i am forcing an app pool to recycle so that i can be sure it reconnects on restart, so it is going through the entire process of recreating the actor system from scratch and reconnecting again
the problem is that on local IIS, when i recycle the app, i can clearly see that the port is no longer held - using netstat command for that.... in QA, when i recycle the app it almost never releases the port completely, the connection stays as ESTABLISHED, even though i can see the web app is going through application start logic
tstojecki
@tstojecki
Feb 17 2016 16:09
if i had two instances of an actor and the first one does Tcp.Bind successfully, then the second one tries, would that second one comes back with this kind of error?
Marc Piechura
@marcpiechura
Feb 17 2016 16:12
I would think so, yes
I have a service that also binds on a port, but there I haven't the issue that a port doesn't get release when I restart the service, so I would assume it's maybe something with IIS
Bartosz Sypytkowski
@Horusiath
Feb 17 2016 19:37
@idursun some code would be helpful, but on the first shot it sounds like you're creating two routers, one per each node
Garrard Kitchen
@garrardkitchen
Feb 17 2016 20:19
Sometimes my nodes hosted in IIS fail to join the cluster whereas my nodes served up via windows services always join. Why would this be?
Aaron Stannard
@Aaronontheweb
Feb 17 2016 20:19
IIS stutters on AppPool start sometimes
and does an instant recycle
I've observed that
and if that node was bound to port 0
and managed to get off a join command before it happened
then it's toast - it will rejoin under a different port
and look like a totally different node
Akka.Cluster is pretty strict about IP:PORT uniqueness
shittiest part of that happens to you
the instant recycle
Garrard Kitchen
@garrardkitchen
Feb 17 2016 20:21
I'm no longer using port 0
Aaron Stannard
@Aaronontheweb
Feb 17 2016 20:21
is you need to immediately hit that site with a web request
to get it to finish
in a world where all .NET developers care about is HTTP
this is ok
in a world where we have our own socket stuff going on unbeknowst to IIS
this is a problem
to which I conclude
I welcome the arrival of our CoreCLR and Kestrel overlords
Garrard Kitchen
@garrardkitchen
Feb 17 2016 20:22
Any guidance on how best to work around this?
Aaron Stannard
@Aaronontheweb
Feb 17 2016 20:22
and tearing down IIS like a statue of Saddam Hussein
my advice is to have a deploy script for your IIS nodes
that jack-hammers a status page until it gets an active response back
load-balancer health check URLs that hit a dynamic route in your app are the best bets
and then disable or at least minimize AppPool recycling
does that make sense?
this is more of an "IIS does weird shit" issue than it is anything to do with Akka.Cluster
Garrard Kitchen
@garrardkitchen
Feb 17 2016 20:26
Yup, set iis to min recycling and I do have a status page. Should I just continue getting cluster status until memberup?
Marc Piechura
@marcpiechura
Feb 17 2016 20:26
@tstojecki maybe that's also the reason for your issue with Akka.IO
Aaron Stannard
@Aaronontheweb
Feb 17 2016 20:26
yeah I would - I'd have the cluster status feed into the load balancer status page
don't return 200 OK until you're up
if being a part of the cluster is essential to making your app work
which I assume it is
tstojecki
@tstojecki
Feb 17 2016 20:27
@Silv3rcircl3 maybe... i was able to replicate by having another actor Tcp.Bind to the same address/port... the problem is that i don't seem to be getting any useful messages back, such as Tcp.CommandFailed
Garrard Kitchen
@garrardkitchen
Feb 17 2016 20:28
It is crucial! Heavily invested in akka but looking a little foolish with prod app failing sometimes. Thanks for advice, very much appreciated!
Aaron Stannard
@Aaronontheweb
Feb 17 2016 20:28
you're welcome!
tstojecki
@tstojecki
Feb 17 2016 20:29

It is crucial! Heavily invested in akka but looking a little foolish with prod app failing sometimes.

@garrardkitchen been there, done that ;-)

Garrard Kitchen
@garrardkitchen
Feb 17 2016 20:31
:smile:
ilhadad
@ilhadad
Feb 17 2016 20:58
@Horusiath @Aaronontheweb We are stuck on the testing of Akka.Persistence.Couchbase. I have uploaded what we have so far. We are getting a timeout on Test Name: Akka.Persistence.CouchBase.Tests.CouchBaseJournalSpec.Journal_should_not_replay_messages_if_count_limit_equals_zero
We can see it getting ready to write to CouchDB and then "boom" timeout. We even tried to increase the timeout of the test to no avail. Please help. Code is at: https://github.com/ilhadad/Akka.Persistence.CouchBase
Marc Piechura
@marcpiechura
Feb 17 2016 21:01
@tstojecki from the internal documentation
If the bind request is rejected because the Tcp system is not able to register more channels (see the nr-of-selectors
 * and max-channels configuration options in the akka.io.tcp section of the configuration) the sender will be notified
 * with a <see cref="Akka.IO.Tcp.CommandFailed"/> message. This message contains the original command for reference.
Oh that doesn't work ^^ anyway it seems that a command failed message is only send back in this two cases
And not when the port is blocked
Marc Piechura
@marcpiechura
Feb 17 2016 21:07
And this is the point where the socket is bound, maybe you could change this func in a local clone and see what you get
voltcode
@voltcode
Feb 17 2016 21:11
For waemup on iis you could also use iis 8 preload enabled http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-application-initialization
Bartosz Sypytkowski
@Horusiath
Feb 17 2016 21:24
@ilhadad I can take a look at it, but I will be probably quite occupied until end of this week
ilhadad
@ilhadad
Feb 17 2016 21:25
Greatly appreciated. We have moved on to use the PersistenceExample project using our plugin so that we can sort out what's going on.
Garrard Kitchen
@garrardkitchen
Feb 17 2016 21:29
Thank you! @voltcode