Skip to content

cleanup_idle_pods aborts the whole sweep on one malformed last-seen annotation #83

Description

@dev-dull

Summary

landing/app/pods.py:239 calls datetime.fromisoformat(last_seen_raw) unguarded inside the per-pod loop of cleanup_idle_pods. If any single pod has a malformed or unparseable sus.dev/last-seen annotation, the exception aborts the entire cleanup pass — no idle pods get reaped that iteration.

The caller (cleanup.py:26-39) catches and logs it, so it's not fatal, but a persistently-bad annotation on one pod blocks reaping of all idle pods indefinitely, which defeats the reaper and can pile up abandoned pods.

Suggested fix

Wrap the per-pod timestamp parse in try/except; on failure, skip that pod (or treat it as stale) and continue the loop instead of letting one bad annotation kill the sweep.

Found during a repo audit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions