temporalio / temporalio/temporal

Background scan to remove unnecessary timers

Open
#574 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

difficulty: medium enhancement operations
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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.