Skip to content

ExecutorConfigurationSupport to allow millisecond precision for await termination period#24496

Closed
ttddyy wants to merge 1 commit into
spring-projects:masterfrom
ttddyy:await-duration
Closed

ExecutorConfigurationSupport to allow millisecond precision for await termination period#24496
ttddyy wants to merge 1 commit into
spring-projects:masterfrom
ttddyy:await-duration

Conversation

@ttddyy

@ttddyy ttddyy commented Feb 10, 2020

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

ttddyy commented Feb 11, 2020

Copy link
Copy Markdown
Contributor Author

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.

4 participants