Repository navigation
fix: Cleanup service fails execution records when reclaiming stale slots (#219) - #227
Merged
Merged
Conversation
…ots (#219) When the cleanup service reclaimed stale Redis slots, the corresponding schedule_executions DB records stayed stuck in 'running' status. Now slot cleanup returns the reclaimed execution IDs and the cleanup service marks them as failed with a guarded WHERE status='running' update to prevent overwriting executions that completed via another path. - Add fail_stale_slot_execution() with race-condition guard - Change cleanup_stale_slots to return Dict[str, List[str]] - Add stale_slot_executions field to CleanupReport - Update tests and cleanup-service feature flow Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
schedule_executionsDB records — when a slot is reclaimed, the corresponding execution is now marked as failedWHERE status='running') to prevent overwriting executions that completed via another pathstale_slot_executionsfield toCleanupReportfor observabilityChanges
src/backend/db/schedules.py— Newfail_stale_slot_execution()with guarded updatesrc/backend/services/slot_service.py—cleanup_stale_slotsreturnsDict[str, List[str]](agent→execution IDs)src/backend/services/cleanup_service.py— Step 3 wired to fail execution records; new report fieldsrc/backend/database.py— Delegation methodtests/test_cleanup_service.py— Updated for newstale_slot_executionsfielddocs/memory/feature-flows/cleanup-service.md— Feature flow updatedTest Plan
pytest tests/test_cleanup_service.py -v— 7/7 passstale_slot_executionsfield present in cleanup status and trigger responsesNotes
finalize_orphaned_skipped_executionsalready handles this caseCloses #219
Generated with Claude Code