spring-projects / spring-statemachine

Spring Statemachine is a framework for application developers to use state machine concepts with Spring.
1.52k stars 598 forks source link

Memory leak "Eternal TimedTrigger" #1084

Open morrv opened 1 year ago

morrv commented 1 year ago

Hello SSM Team,

I noticed a memory leak in my application using SSM.

When the "resetStateMachineReactively(...)" method is applied with currentState that contains a timer() in configuration, (...withInternal().source(States.ORDERING_JOB).timer(30000).action(orderJob()).and()...) it is started at the end of the method. start

However, after the context is terminated, it will not be stopped. It continues to exist ad infinitum.

The triggered() method (in "ReactiveStateMachineExecutor") then always adds "TriggerQueueItem" to the "triggerSink" list, which gradually keeps growing. (confirmed in java heap dump) register

trigger

Thanks in advance