Repository navigation
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 3 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
✅ SSOT Configuration Compliance: Passing🎉 No new hardcoded values of either class — Known backlog in |
|
Code review on PR #20475 (head 55c9997): approve. Read directly; psutil 7.2.2 |
Refs #20466
Thinking Path
A heartbeat's run key was revoked about 20 seconds into a run that worked for 7 more minutes. The key is only revoked after
_await_adapter_completionreturns, so the status check must have read a live process as finished. On this host the exactcreate_timecomparison does that.What Changed
llc/adapters/subprocess_support.py: process identity compares_start_stamp, psutil's own identity value, instead ofcreate_time(). On Linux that is monotonic jiffies since boot, which doesn't change. PID-reuse protection stays: a different stamp still reads as ended, andterminate_pidstill refuses to signal a mismatch.Why: psutil's
create_time()is jiffies since boot plusboot_time(), re-read from/proc/stateach call. On the WSL2 hostbtimemoved down by a second every 10 to 60 seconds, measured. So one live process'screate_timechanges between reads, an exact==fails, the status reads COMPLETED, and the key is revoked. Reading the run as finished also meant status and usage were read too soon.Ruled out: a shared state path (state files are keyed by pid), and another revoker (
revoke_run_keyhas one caller).Verification
test_run_identity_survives_clock_drift_20466.py, with a real detached process: alive across 5 polls while boot time drifts; killed then reads ended; a different stamp reads ended;terminate_pidstill works after drift. Without the fix the 2 drift tests fail.llc/testsplusllc/adapters/tests, whole: 2837 passed, 2 skipped.Not established:
_identis a private psutil attribute, because the publiccreate_time()takes no monotonic argument in 7.2.2. The alternative is parsing/proc/<pid>/stat.Model Used
Claude Opus 5.5
🤖 Generated with Claude Code