Repository navigation
fix(ttl-reaper): log unparseable ttl-deadline only when it fails to parse (#1524) - #1545
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…arse (#1524) The log line sat after the parse block instead of in its else, so every instance with a valid future deadline (which falls through to the max-age ceiling since #824) logged it on every cycle. Decisions are unchanged. Co-Authored-By: Claude <[email protected]>
scttfrdmn
force-pushed
the
fix/1524-reaper-deadline-log
branch
from
November 6, 2026 17:38
a4076bd to
2e54b15
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1524
What
lambda/ttl-reaperevaluateloggedinstance <id>: unparseable ttl-deadline "<value>", falling back to spawn:ttl, then max-agefor every instance whosespawn:ttl-deadlineparsed and was still in the future. Thelog.Printfsat after theif deadline, err := time.Parse(...); err == nil { ... }block instead of in itselse. It now sits in theelse, so it fires only for a value that does not parse.Root cause, and is the decision affected?
The slip came in with #824 (e167ed4). That PR replaced the within-deadline
return candidate{}, falsewith a fall-through to the max-age ceiling, but left the log line where it was. Before #824 thereturnmade the line unreachable for a valid deadline. After it, every valid future deadline reached the line.No reap decision changes.
haveDeadlinewas already set inside the parse block, so a valid deadline skipped thespawn:ttlfallback, and the max-age ceiling applied either way. Only the log line was misplaced. The decision logic around it is correct. The FSx path (evaluateFSx) has the same shape but returns inside the parse block, so it never had the bug.Test
lambda/ttl-reaper/deadline_log_test.gocaptures the log with the existingcaptureLogshelper. For each case it asserts both whether the line appears and the decision (expired,reason):ttl-deadlinemax-agemax-agespawn:ttlttl(the fallback still runs)Revert gate: with
main.goreverted and the test kept, the test fails:All decision assertions pass on both sides of the revert, which shows the decision did not change.
Deploy
The ttl-reaper is a deployed Lambda. The fix takes effect only when it is redeployed. On the release's deploy checklist it should appear as code-only: no template, parameter or IAM change.
Checks (hermetic: AWS env stripped)
lambda/ttl-reaper:go test ./...passes, plusgofmtandgo vetmake check: passesgo test ./...: passesmake test-e2e-tier0: passessemgrep scan --config=auto --error lambda/ttl-reaper: cleanmake gen-docs/make api-snapshot: not affected (no CLI orpkg/API change)🤖 Generated with Claude Code