Repository navigation
OpenConceptLab/ocl_issues#2830 | expire Auto Match runs left running for over 24 hours - #960
Conversation
…for over 24 hours
|
This is the server side of OpenConceptLab/ocl_issues#2830. It covers the case flagged in review on OpenConceptLab/oclmap#114: a tab that closes while the run's create request is in flight leaves the record 🤖 Generated with Claude Code |
snyaggarwal
left a comment
There was a problem hiding this comment.
Re-reviewed alongside Mapper PR #114. The hourly task covers the orphaned run-record case when the tab closes before the create response arrives. I found no additional blocker in this PR. Please confirm the 24-hour inactivity cutoff exceeds the longest legitimate run before deployment.
|
Codex review, pass 1 (codex-cli 0.164.0, commit cc93552) An independent pass for my review. Verdict: clean. No findings. On the 24-hour cutoff: the longest Auto Match run that has finished in production took 2.4 hours, and the 99th percentile is under 2 hours, so 24 hours leaves a wide margin. There are 11 records still findings.json{
"reviewer": "codex-cli 0.164.0",
"perspective": "defects",
"mode": "full",
"commit": "cc93552",
"verdict": "clean",
"prior": [],
"findings": []
} |
paynejd
left a comment
There was a problem hiding this comment.
Approving. Codex found nothing (pass above), and 24 hours is about 10× the longest run in production. This can merge before OpenConceptLab/oclmap#114, which has open findings.
Part of OpenConceptLab/ocl_issues#2830, alongside OpenConceptLab/oclmap#114.
The Mapper closes an Auto Match run's record when the run ends, when the user leaves the project, and as the tab closes. It can't close one whose create request was still in flight when the tab closed: the browser never gets the run id, so the record stays
runningfor good. This closes such records on the server.Changes
AutomatchRun.expire_stale(older_than=None)marks runs stillrunningwith no update forSTALE_AFTER(24 hours) ascancelledand setscompleted_at. It returns how many it changed.expire_stale_auto_match_runscelery task, scheduled hourly inCELERYBEAT_SCHEDULE.Notes
STALE_AFTERif runs can last longer.cancelled.completed_atkeeps the expiry time.Testing
python manage.py test core.map_projects: 71 pass, including 3 new tests inAutomatchRunExpireStaleTest.🤖 Generated with Claude Code