-
Notifications
You must be signed in to change notification settings - Fork 304
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
TaskLifecycleListener triggers early, and possibly cyclical, bean initialisation when an ApplicationEvent is published #448
Comments
Another failure which, I think, is due to early initialisation can be reproduced with the following steps:
|
cppwfs
added a commit
to cppwfs/spring-cloud-task
that referenced
this issue
Oct 2, 2018
…tialisation Replaced TaskListenerExecutorFactory with TaskListenerExecutorObjectProviderTests. This delays the need to acquire a bean till it is needed vs at application event time. resolves spring-cloud#448
cppwfs
added a commit
to cppwfs/spring-cloud-task
that referenced
this issue
Oct 2, 2018
…tialisation Replaced TaskListenerExecutorFactory with TaskListenerExecutorObjectProviderTests. This delays the need to acquire a bean till it is needed vs at application event time. resolves spring-cloud#448
cppwfs
added a commit
to cppwfs/spring-cloud-task
that referenced
this issue
Oct 2, 2018
…tialisation Replaced TaskListenerExecutorFactory with TaskListenerExecutorObjectProviderTests. This delays the need to acquire a bean till it is needed vs at application event time. resolves spring-cloud#448
cppwfs
added a commit
to cppwfs/spring-cloud-task
that referenced
this issue
Oct 23, 2018
…tialisation Replaced TaskListenerExecutorFactory with TaskListenerExecutorObjectProviderTests. This delays the need to acquire a bean till it is needed vs at application event time. resolves spring-cloud#448
cppwfs
added a commit
to cppwfs/spring-cloud-task
that referenced
this issue
Oct 25, 2018
…tialisation Replaced TaskListenerExecutorFactory with TaskListenerExecutorObjectProviderTests. This delays the need to acquire a bean till it is needed vs at application event time. resolves spring-cloud#448
cppwfs
added a commit
to cppwfs/spring-cloud-task
that referenced
this issue
Oct 26, 2018
…tialisation Replaced TaskListenerExecutorFactory with TaskListenerExecutorObjectProviderTests. This delays the need to acquire a bean till it is needed vs at application event time. resolves spring-cloud#448
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TaskLifecycleListener
has quite a broad and deep dependency graph and, due to it being anApplicationListener<ApplicationEvent>
, this entire graph is initialized the first time anyApplicationEvent
is published after the listener has been defined. In addition to the dependency cycles described in this Spring Boot issue, triggering early initialisation can also cause more subtle problems. For both reasons it should be avoided.You can reproduce a failure with Spring Cloud Task 1.2.3 with the following steps:
git checkout v1.2.3.RELEASE
echo SELECT 1 > spring-cloud-task-samples/jpa-sample/src/main/resources/schema.sql
./mvnw -f spring-cloud-task-samples/jpa-sample clean test
The text was updated successfully, but these errors were encountered: