Skip to content

Support immediate GC cleanup when MaxTTL <= 0 #7008

@pingsutw

Description

@pingsutw

Summary

Currently, the TaskAction garbage collector validates that MaxTTL > 0 when GC is enabled (Interval > 0). Setting MaxTTL to 0 or a negative value returns an error.

We could instead treat MaxTTL <= 0 as "delete terminal TaskActions immediately" (i.e., on the next GC cycle). This would be useful for environments where operators want to aggressively clean up completed TaskActions without waiting.

Proposed behavior

MaxTTL value Behavior
> 0 Delete terminal TaskActions older than MaxTTL (current behavior)
<= 0 Delete all terminal TaskActions immediately on each GC cycle

Context

Raised during PR #6994 review. Current code defensively rejects MaxTTL <= 0 to prevent accidental deletion of all terminal TaskActions.

Considerations

  • Need clear documentation so operators understand MaxTTL: 0 means immediate deletion
  • Consider whether a named sentinel (e.g., maxTTL: immediate) would be clearer than relying on 0

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions