-
Notifications
You must be signed in to change notification settings - Fork 800
Support immediate GC cleanup when MaxTTL <= 0 #7008
Copy link
Copy link
Open
Labels
Description
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: 0means immediate deletion - Consider whether a named sentinel (e.g.,
maxTTL: immediate) would be clearer than relying on0
Reactions are currently unavailable