Saga does not transition into Final

56 views
Skip to first unread message

Diego Frata

unread,
Jun 29, 2016, 1:52:10 PM6/29/16
to masstransit-discuss
I have the following code. It runs fine up, I see the messaged printed to the log, but saga does not finalize (is being kept alive in the repository causing memory leaks).

During(WaitingForMixResponse,
    When(ResultReady)
        .Unschedule(MixTimedOut)        
        .Publish(m => new SaveMix(Guid.NewGuid(), m.Instance.MixedResult))
        .Then(m => _logger.Info("Mix saved.")))
        .Finalize();


If I comment both Unschedule and Publish, it gets finalized and removed from the repository. 

Also, if I put the Finalize on the top of the chain like below, then everything works.

During(WaitingForMixResponse,
    When(ResultReady)
        .Finalize()   
        .Unschedule(MixTimedOut)        
        .Publish(m => new SaveMix(Guid.NewGuid(), m.Instance.MixedResult))
        .Then(m => _logger.Info("Mix saved.")));



As far as I understand, the order of the Finalize shouldn't matter. I'm using MT 3.3.5, but reproduced on earlier versions. There are other states in my Saga, but the behaviour is displayed across several other Sagas. I'm calling SetCompletedWhenFinalized(); in all constructors.

Any ideas?

Alexey Zimarev

unread,
Jul 5, 2016, 3:14:10 AM7/5/16
to masstransit-discuss
I have similar issues with TransitTo and wondering if this is somehow related to the saga persistence. What persistence do you use, SQL Server?

Diego Frata

unread,
Jul 5, 2016, 6:44:22 AM7/5/16
to masstransit-discuss
Hi Alexey,

I'm using the InMemorySagaRepository. My understanding of the issue evolved a bit since this e-mail. I raised an issue on GitHub, take a look: https://github.com/MassTransit/MassTransit/issues/600

Regards

--
You received this message because you are subscribed to a topic in the Google Groups "masstransit-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/masstransit-discuss/0W7HycyOV9I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to masstransit-dis...@googlegroups.com.
To post to this group, send email to masstrans...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/b86df283-a272-42ac-83d7-4bfc42d78021%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages