These are chat archives for akkadotnet/akka.net

7th
Nov 2015
Roger Johansson
@rogeralsing
Nov 07 2015 08:34
@Horusiath can you create a gist with the failing serialization cases?
Bartosz Sypytkowski
@Horusiath
Nov 07 2015 08:34
rogeralsing/Wire#13
Roger Johansson
@rogeralsing
Nov 07 2015 08:38
:+1:
Bartosz Sypytkowski
@Horusiath
Nov 07 2015 08:40
@rogeralsing how do you emit code for type serializers?
Roger Johansson
@rogeralsing
Nov 07 2015 08:40
using Linq.Expressions
stupid question maybe but the immutabledictionary, is that from F#? or from one of the immutable collection libs?
Bartosz Sypytkowski
@Horusiath
Nov 07 2015 08:45
each immutable data type has static method CreateRange<T>(IEnumerable<T>) or CreateRange<TKey, TValue>(IEnumerable<KeyValuePair<TKey, TValue>>)
no, it's the one from MS
in F# (and any language not being C#) it's called a Map
Roger Johansson
@rogeralsing
Nov 07 2015 08:53
ok, yes I see the problem here, I have a half-assed impl for serializing ienumerables. I need to finish that
Kamil Wojciechowski
@aph5nt
Nov 07 2015 12:37
yo, I need some help
I have a schedule defined like this
moduleActor.System.Scheduler.ScheduleTellRepeatedly(TimeSpan.FromSeconds(startAfter()), TimeSpan.FromSeconds(settings.Scheduler.PlayGame), moduleActor.GameActor, Draw(getDate().Value))
and the question is how to enforce Draw message to be send with the new datetime eachtime ?
(its f# related question)
it seems that this is being cached
even if I use getDate() method
tried with fun()-> Draw(DateTime.UtcNow) - but still same behaviour
should I write my schedules in C# ? :D
Zetanova
@Zetanova
Nov 07 2015 14:37
@aph5nt fun()-> Draw(DateTime.UtcNow) shoudl work. maybe if u miss some executions and the scheduler is queuing/executiong them rapitly later.
Zetanova
@Zetanova
Nov 07 2015 14:43
@aph5nt Near all graphic engines using a dedicated thread to render and maybe double buffering for it. YOu can use the same thread or create a deticted for your rendering too. you can use the scheduler not for doing "work" just set an AutoResetEvent on it.
Kamil Wojciechowski
@aph5nt
Nov 07 2015 16:55
@Zetanova : I used System.Threading.Timer as a workaround - works fine now
Kamil Wojciechowski
@aph5nt
Nov 07 2015 17:11
What is the proper way for recovering persistend actor from failure? I can handle a RecoveryFailure message
but what should I do then ? return state ?
| :? RecoveryFailure as e -> state
??
Bartosz Sypytkowski
@Horusiath
Nov 07 2015 17:12
@aph5nt bascially, the best way is to stop an actor and recover it later in the future
taking into account, that recovery logic should consist only from the state updates, the thing that most probably can go wrong is failure of data store used by the journal
i.e. when database is dead. In this case immediate recreation of the PA has no sense, it's better to apply some exponential backoff and try to recreate it later
Kamil Wojciechowski
@aph5nt
Nov 07 2015 17:16
@Horusiath thx
Bartosz Sypytkowski
@Horusiath
Nov 07 2015 17:16
This message was deleted
Christian Duhard
@cduhard
Nov 07 2015 18:05
i am back at trying to figure out why I am getting [Debug] Resolve of path sequence [/"user/contact-pool-e4338572-5484-4e67-94d5-59e7289d207e/$b"] failed when the journal replays
Bartosz Sypytkowski
@Horusiath
Nov 07 2015 18:07
@cduhard what is this contact-pool-xyz actor?
Christian Duhard
@cduhard
Nov 07 2015 18:08
it`s a roundrobin pool
Bartosz Sypytkowski
@Horusiath
Nov 07 2015 18:08
but for what actor?
Christian Duhard
@cduhard
Nov 07 2015 18:09
not sure what you mean
its a worker pool provided to an aggregate root by the coordinator
Bartosz Sypytkowski
@Horusiath
Nov 07 2015 18:10
without context it's gonna be hard to help
Christian Duhard
@cduhard
Nov 07 2015 18:11
i understand, but I am not sure what info would help
anything more specific?
Bartosz Sypytkowski
@Horusiath
Nov 07 2015 18:12
how the dataflow looks like?
Christian Duhard
@cduhard
Nov 07 2015 18:12
the pool isn't even used in replaying the journal
thats why i am at a losss
i am also using EventStore as the storage
Bartosz Sypytkowski
@Horusiath
Nov 07 2015 18:14
why should journal even contact with worker pool?
Christian Duhard
@cduhard
Nov 07 2015 18:14
its doesn't
but those messages appear for every event replayed
it
s weird
@Aaronontheweb posted the code where that message gets created
he said he's never seen it before
thought maybe Monitoring was causing it, wasn't. gonna test with just passing a single worker right now
Christian Duhard
@cduhard
Nov 07 2015 18:28
ok i figured it out
i was looking in the wrong place, still don't know why
the Persist method is serializing the sender even though it's coming in as null
        protected void Persist(IEvent domainEvent, IActorRef sender = null)
        {
            Persist(domainEvent, e =>
            {
                UpdateState(domainEvent, sender);
                Publish(e);

                // if persisted events counter already exceeded the MaxEventsToSnapshot limit
                // snapshot will be automatically stored and counter will reset
                if ((_eventsSinceLastSnapshot++) >= MaxEventsToSnapshot)
                {
                    SaveSnapshot(State);
                    _eventsSinceLastSnapshot = 0;
                }
            });
        }
Christian Duhard
@cduhard
Nov 07 2015 18:34
its called like this:
Persist(new Events.Relayed(Guid.NewGuid(), _id, State.AccountId, p.Thing, resultsGroup,  p.Score, Clock()));
the message appears when the sender path doesn't exist on deserialize
it's definitely not using a null sender
Zetanova
@Zetanova
Nov 07 2015 18:38
@cduhard yes u are. Extend to: Persist(new Events.Relayed(Guid.NewGuid(), _id, State.AccountId, p.Thing, resultsGroup, p.Score, Clock()), Sender);
Christian Duhard
@cduhard
Nov 07 2015 18:39
no, what I mean is it's definitely serializing a Sender that isn't null even though I don't pass one
This message was deleted
Christian Duhard
@cduhard
Nov 07 2015 18:46
is this a bug?
or me? :)
Bartosz Sypytkowski
@Horusiath
Nov 07 2015 18:47
how does your UpdateState looks like?
Christian Duhard
@cduhard
Nov 07 2015 18:47
pretty great! ;)
Bartosz Sypytkowski
@Horusiath
Nov 07 2015 18:48
are you sending something back?
Christian Duhard
@cduhard
Nov 07 2015 18:48
nope
just updating internal state, pretty standard stuff
nothing with side effects
i am curious why the Sender gets serialized with the event, when I never pass it in
my instinct is always, "it's probably my fault"
Bartosz Sypytkowski
@Horusiath
Nov 07 2015 18:51
Persist is serializing a sender, but some bug may appear somewhere in there
could you create an issue for that?
Christian Duhard
@cduhard
Nov 07 2015 18:54
where does it serialize a sender?
the method signature of Persist in agg root is sender=null, looking at the persist in EventSourced i don't see a sender there
Roger Johansson
@rogeralsing
Nov 07 2015 19:01
btw. dont know if this is relevant, but if you send a message with a null sender to another actor, the receiving actor will translate the null sender to DeadLetters upon receiving
Christian Duhard
@cduhard
Nov 07 2015 19:04
no, while good to know, this isn't happening here
Bartosz Sypytkowski
@Horusiath
Nov 07 2015 19:05
@cduhard this way or another - please set a github issue for that. I don't want to point you a wrong direction, but right now I feel to tired to perform any logical thinking atm ;)
Christian Duhard
@cduhard
Nov 07 2015 19:07
@rogeralsing send null explicitly you mean?
Roger Johansson
@rogeralsing
Nov 07 2015 19:08
yes.. e.g. foo.Tell(someMessage,null) or foo.Tell(someMessage,ActorRefs.NoSender) will both be converted to DeadLetters when the message is received
Christian Duhard
@cduhard
Nov 07 2015 19:09
gotcha, i was confused by the fact there is an overload with out a sender :)
is there any sample code dealing with DeadLetters?