Skip to content

Reaper TTL logic unreachable for Pending/Running tasks #905

@coderabbitai

Description

@coderabbitai

Problem

The TaskReaper.Run() method in reaper/task.go has a SQL query that excludes Pending and Running states from selection, but the subsequent switch statement still contains handlers for these states. This means the TTL logic for Pending and Running tasks will never execute.

Current Query

The query currently filters for:

state IN ? and released = ?

With states: Created, Succeeded, Failed, Canceled

Missing States

The query should also include:

  • task.Pending
  • task.Running

Impact

Tasks in Pending or Running states will not be reaped according to their TTL settings, potentially leading to resource accumulation.

Related

Metadata

Metadata

Assignees

Labels

needs-kindIndicates an issue or PR lacks a `kind/foo` label and requires one.needs-priorityIndicates an issue or PR lacks a `priority/foo` label and requires one.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

Type

No type

Projects

Status

🏗 In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions