CloudAgent - Fix idle cleanup skipping sessions with no executions#3185
CloudAgent - Fix idle cleanup skipping sessions with no executions#3185eshurakov wants to merge 1 commit into
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge OverviewTwo commits reviewed. Both are correct. Commit 1 ( Commit 2 ( Files Reviewed (1 file)
Reviewed by claude-sonnet-4.6 · 300,040 tokens |
evanjacobson
left a comment
There was a problem hiding this comment.
Approved. DM'd a comment that it would be nice to have a regression test alongside this change to avoid this in the future
…n no executions exist
41a7a2b to
155288c
Compare
Summary
Fix a regression from #3176 where
cleanupIdleKiloServerreturned early for sessions with zero executions, leaving their containers running indefinitely. When no executions exist, the method now falls back tometadata.preparedAt(set when the session is prepared and the container starts) to compute idle time. If neither executions norpreparedAtexist, it returns early — those sessions genuinely have nothing to clean up.This caused both "Session has not been initiated yet" errors (containers alive but preparation never completed) and containers hanging around without being killed (the reaper alarm skipped them every cycle).
Verification
Confirmed via Axiom logs that the success rate for
prepareSessioncollapsed from ~80% to ~12% starting at 15:30 UTC today, exactly when #3176 was deployed.