Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Machine from StateMachineBuilder may prevent jvm exit #624

Open
jvalkeal opened this issue Jan 21, 2019 · 0 comments
Open

Machine from StateMachineBuilder may prevent jvm exit #624

jvalkeal opened this issue Jan 21, 2019 · 0 comments
Labels
type/enhancement Is an enhancement request

Comments

@jvalkeal
Copy link
Contributor

On default TaskScheduler is configured to use org.springframework.scheduling.concurrent.ConcurrentTaskScheduler which then gets used with state actions. Unfortunate side effect for this is that jvm shutdown will get blocked. While workaround is to replace your own TaskScheduler, we should figure out how to change this so that default functionality would not be so bad.

@jvalkeal jvalkeal added the type/enhancement Is an enhancement request label Jan 21, 2019
RenanSFreitas pushed a commit to RenanSFreitas/spring-statemachine that referenced this issue Aug 21, 2022
ConcurrentTaskScheduler doesn't expose any way for it's inner executor to be shutdown,
when it's instance is created with the default constructor. This can lead to a scenario
where a library user ends up with many unused threads with no clear cues about where they
came from.

This commit replaces the usage of ConcurrentTaskScheduler with ThreadPoolTaskScheduler,
a type of similar semantics but better API, which includes methods for managing its
internal resources lifecycle. Also it implements spring-beans interfaces which makes
it more suitable to be managed by a Spring application context.

- Fixes spring-projects#624
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Is an enhancement request
Projects
None yet
Development

No branches or pull requests

1 participant