Skip to content

ThreadPoolTaskScheduleBuilder unnecessarily loses precision when configuring await termination time#50225

Merged
snicoll merged 2 commits intospring-projects:3.5.xfrom
ares333:patch-1
Apr 28, 2026
Merged

ThreadPoolTaskScheduleBuilder unnecessarily loses precision when configuring await termination time#50225
snicoll merged 2 commits intospring-projects:3.5.xfrom
ares333:patch-1

Conversation

@ares333
Copy link
Copy Markdown
Contributor

@ares333 ares333 commented Apr 27, 2026

ThreadPoolTaskSchedulerBuilder.awaitTerminationPeriod lost millisecond information and fix it.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 27, 2026
@wilkinsona
Copy link
Copy Markdown
Member

Thank you for the PR, @ares333. Can you please update the tests to verify that the millisecond precision is retained? Perhaps by modifying the existing ThreadPoolTaskSchedulerBuilderTests.awaitTerminationPeriodShouldApply() method to use a Duration.ofMillis().

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label Apr 27, 2026
@ares333
Copy link
Copy Markdown
Contributor Author

ares333 commented Apr 27, 2026

updated the test to use Duration.ofMillis() and verified that the millisecond precision is retained.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Apr 27, 2026
@wilkinsona wilkinsona changed the title Change awaitTerminationPeriod to use milliseconds ThreadPoolTaskScheduleBuilder unnecessarily loses precision when configuring await termination time Apr 27, 2026
@wilkinsona wilkinsona added this to the 3.5.x milestone Apr 27, 2026
@wilkinsona wilkinsona added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged status: feedback-provided Feedback has been provided labels Apr 27, 2026
quaff added a commit to quaff/spring-framework that referenced this pull request Apr 28, 2026
…illis

We should encourage using milliseconds over seconds for better precision, see spring-projects/spring-boot#50225

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
@snicoll snicoll self-assigned this Apr 28, 2026
ares333 and others added 2 commits April 28, 2026 13:46
This commit fixes ThreadPoolTaskExecutorBuilder#awaitTerminationPeriod
so that it does not lose millisecond precision.

See spring-projectsgh-50225

Signed-off-by: Ares <ares333@users.noreply.github.com>
@snicoll snicoll modified the milestones: 3.5.x, 3.5.15 Apr 28, 2026
@snicoll snicoll changed the base branch from main to 3.5.x April 28, 2026 11:54
@snicoll snicoll merged commit fa87657 into spring-projects:3.5.x Apr 28, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants