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

Batch application does not shutdown #2217

Merged
merged 1 commit into from
Nov 29, 2022
Merged

Batch application does not shutdown #2217

merged 1 commit into from
Nov 29, 2022

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.

None yet

3 participants