You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The async stop listener provided in #9092 is not actually fired after a call to stop().
Once stop is called() the DMLC threads notice isRunning is false and park themselves inside waitWhileNotRunning(). This method blocks until the DMLC is de-actived (as a result of calling shutdown) or the DMLC is re-started.
The attached test case demonstrates the issue.
It looks like waitWhileNotRunning() should probably call the async-stop runnable once all processor threads get to that point or isActive() should return false after a call to stop()?
This problem actually only shows with the default TaskExecutor, where invoker threads keep running and waiting. If you specify a SchedulingTaskExecutor (any of the thread-pooling ones), then DefaultMessageListenerContainer will automatically use a shorter maxMessagesPerTask setting that allows invoker threads to return to the pool - and also to invoke the stop notification.
So for the time being, try specifying an thread-pooling TaskExecutor. I'll see what I can do to invoke the stop notification for the default TaskExecutor as well.
I've added the stop notification capability for ongoing loops (i.e. unlimited maxMessagesPerTask which is the default when not using an external TaskExecutor) as well now.
This will be available in tonight's 2.5.6 snapshot. Please give it a try and let me know whether it works for you!
Ben Rowlands opened SPR-5198 and commented
The async stop listener provided in #9092 is not actually fired after a call to stop().
Once stop is called() the DMLC threads notice isRunning is false and park themselves inside waitWhileNotRunning(). This method blocks until the DMLC is de-actived (as a result of calling shutdown) or the DMLC is re-started.
The attached test case demonstrates the issue.
It looks like waitWhileNotRunning() should probably call the async-stop runnable once all processor threads get to that point or isActive() should return false after a call to stop()?
Affects: 2.5.5
Attachments:
Issue Links:
2 votes, 4 watchers
The text was updated successfully, but these errors were encountered: