Skip to content

Conversation

@JordiMartinezVicent
Copy link
Contributor

When a batch application ends, the application does not shut down.

It is due to the thread created by ZipkinAutoConfiguration (non deamon thread) is supposed to be terminated at:

        @PreDestroy
	void cleanup() {
		this.zipkinExecutor.shutdown();
	}

But it is not executed because still exists a non daeman thread. (The thread create by the zipkinExecutor itself)

At the PR you can see that the executor is shutdown when the task is completed. I think it is the best option because it is not used anymore.

Also the shutdown is executed by the executor thread itself, in order to not block the main thread which is executing the startup of the application.

I have attached a simple batch application which does nothing a part from starting and stopping to check the issue.

spring-batch.zip

@marcingrzejszczak marcingrzejszczak added this to the 3.1.5 milestone Oct 19, 2022
@marcingrzejszczak marcingrzejszczak merged commit f0f4444 into spring-cloud:3.1.x Nov 29, 2022
@marcingrzejszczak marcingrzejszczak modified the milestones: 3.1.5, 3.1.6 Nov 29, 2022
@JordiMartinezVicent JordiMartinezVicent deleted the fix-no-shutdown branch December 1, 2022 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants