temporalio / temporalio/temporal
Background scan to remove unnecessary timers
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 23.2k
- Forks
- 1.9k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 228
Description
Is your feature request related to a problem? Please describe.
There are many situations where tasks in Temporal are protected by timeout tasks. Most of the time these timers end up being redundant when workflows/tasks complete successfully.
Further user can create user timers in the future and never need them because workflow completes well before them.
Describe the solution you'd like
I'm proposing a background job which scans all timer queues and delete any tasks for expired workflows/tasks.
One thing to consider is that we use range deletes when cleaning up timer queues and moving cursor. This may need not be an option to remove tasks individually.
Describe alternatives you've considered
Additional context
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the timer queues and the existing cleanup path, especially how range deletes and cursor movement work. The work is done when a background job scans timer queues and removes tasks belonging to expired workflows or tasks without breaking existing cleanup behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend, distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100