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

ExecutorConfigurationSupport to allow millisecond precision for await termination period #24496

Closed
wants to merge 1 commit into from

Conversation

ttddyy
Copy link
Contributor

@ttddyy ttddyy commented Feb 10, 2020

I noticed ExecutorConfigurationSupport(ThreadPoolTask[Executor|Scheduler]) only takes seconds for await termination.

I'm writing a graceful shutdown logic for k8s environment and awaiting by second is a bit large granularity to control the shutdown/await. Graceful shutdown get triggered by liveness probe and the frequency for liveness probe is not so long.

This PR changes the minimum unit to milliseconds and adds a method to take Duration to specify the await termination.

Add "ExecutorConfigurationSupport#setAwaitTerminationDuration" which takes
"Duration" to await internal executor termination.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Feb 10, 2020
@rstoyanchev rstoyanchev added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement labels Feb 11, 2020
@rstoyanchev rstoyanchev added this to the 5.2.4 milestone Feb 11, 2020
@rstoyanchev rstoyanchev self-assigned this Feb 11, 2020
@jhoeller jhoeller removed the status: waiting-for-triage An issue we've not yet triaged or decided on label Feb 11, 2020
@rstoyanchev
Copy link
Contributor

I've turned that into awaitTerminationMillis which is usable for XML config, consistent with the rest of the framework, itself a shortcut for a Duration.

@rstoyanchev rstoyanchev changed the title ExecutorConfigurationSupport to take Duration for await termination period ExecutorConfigurationSupport to allow millisecond precision for await termination period Feb 11, 2020
@ttddyy
Copy link
Contributor Author

ttddyy commented Feb 11, 2020

cool, thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants