Skip to content

ttl-reaper: logs "unparseable ttl-deadline" for every instance with a valid future deadline #1524

Closed

Description

@scttfrdmn

lambda/ttl-reaper/main.go evaluate logs instance <id>: unparseable ttl-deadline "<value>", falling back to spawn:ttl, then max-age for every instance whose spawn:ttl-deadline parses fine and is still in the future.

Why: the log.Printf sits after the inner if deadline, err := time.Parse(...); err == nil { ... } block, not in an else. When a parsed deadline has not passed, control falls through to the max-age check, as intended, and runs the log line on the way out.

if dl := tags[tagprefix.Tag("ttl-deadline")]; dl != "" {
    if deadline, err := time.Parse(time.RFC3339, dl); err == nil {
        haveDeadline = true
        if now.After(deadline) && !r.leaveToSpored(...) { ... return c, true }
        // Within deadline: fall through to the max-age ceiling below.
    }
    log.Printf("instance %s: unparseable ttl-deadline %q, ...", id, dl)   // runs for a VALID deadline too
}

Evidence: found while writing #1515 phase 5's reaper coverage test (lambda/ttl-reaper/egress_proxy_test.go, PR for #1515 phase 5). Evaluating the egress proxy's real tag set a minute before its deadline prints:

instance i-proxy: unparseable ttl-deadline "2026-11-09T12:00:00Z", falling back to spawn:ttl, then max-age

Impact: log only. haveDeadline is set, so the spawn:ttl fallback is skipped and the max-age ceiling still applies, and nothing is reaped wrongly. But each reaper cycle writes this false line once for every live spawn instance that has a deadline, which is most of them. A real unparseable deadline is then indistinguishable from noise in CloudWatch.

Fix: guard the line with if !haveDeadline, and add a test that a future, valid deadline logs nothing. The reaper is a deployed Lambda, so this needs a redeploy to take effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:lifecyclebugcomponent:spawn

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions