spring-projects / spring-projects/spring-framework

Emit warning when ThreadPoolTaskScheduler is unable to meet task delay

Open
#33,856 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: core type: enhancement
Dominant language
Java
Stars
60.2k
Forks
38.8k
Avg merge
5d 2h
Merged PRs (30d)
27

Description

It seems like a pretty common gotcha for applications with more than one type of scheduled task to run into issues when those tasks are long running and the default value for spring.task.scheduling.pool.size is 1.

Virtual threads in Spring Boot obviously helps mitigate this, but for other uses if ThreadPoolTaskScheduler had a dedicated thread to peek the queue and determine if the next RunnableScheduledFuture delay had expired and log a warning, that would make it far easier to diagnose when thread starvation is preventing tasks from running on schedule.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with ThreadPoolTaskScheduler and trace how its scheduled queue exposes RunnableScheduledFuture delays. Confirm how an overdue task can be detected without disrupting scheduling, then define the warning behavior for thread starvation and verify that long-running tasks produce a useful warning when later tasks miss their delay.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.