fix: recover orphaned jobs on startup with error message (#100)#102
Conversation
|
Report bugs in Issues Welcome! 🎉This pull request will be automatically processed with the following features: 🔄 Automatic Actions
📋 Available CommandsPR Status Management
Review & Approval
Testing & Validation
Container Operations
Cherry-pick Operations
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
AI Features
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
Code Review by Qodo
1.
|
Review Summary by QodoRecover orphaned jobs on startup with error message and timestamp
WalkthroughsDescription• Add error column to results table with migration • Mark orphaned pending/running jobs failed with error message and timestamp • Return tuple of (waiting_jobs, recovered_jobs) from mark_stale_results_failed() • Log per-job recovery details during startup for orphaned jobs • Expose error field in dashboard and detail API responses Diagramflowchart LR
A["Server Startup"] --> B["mark_stale_results_failed()"]
B --> C["Collect Orphaned Jobs"]
C --> D["Update with Error & Timestamp"]
D --> E["Return Tuple"]
E --> F["waiting_jobs"]
E --> G["recovered_jobs"]
G --> H["Per-job INFO Logging"]
F --> I["Resume Background Tasks"]
D --> J["Expose error in API"]
File Changes1. src/rootcoz/storage.py
|
|
@qodo-code-review[bot] The following review comments were reviewed and a decision was made:
|
|
Code review by qodo was updated up to the latest commit b5bd2b5 |
|
Code review by qodo was updated up to the latest commit e9f9f4d |
|
@qodo-code-review[bot] The following review comments were reviewed and a decision was made:
|
…on timestamp - Add 'error' column to results table via migration - Set error message and completed_at on orphaned pending/running jobs marked failed during startup recovery - Return per-job recovery details (job_id + previous_status) from mark_stale_results_failed() for per-job INFO logging in lifespan - Add ORPHAN_STATUSES and RESTART_ERROR_MSG module-level constants cross-referenced with ACTIVE_STATUSES - Expose error field in get_result() and list_results_for_dashboard() - Update existing tests for tuple return type; add error/completed_at assertions Closes #100
e9f9f4d to
b6f2bdd
Compare
|
Code review by qodo was updated up to the latest commit b6f2bdd |
|
Code review by qodo was updated up to the latest commit 132bf4e |
|
@qodo-code-review[bot] The following review comments were reviewed and a decision was made:
|
|
@qodo-code-review[bot] The following review comments were reviewed and a decision was made:
|
|
New container for ghcr.io/ghcr.io/myk-org/rootcoz:latest published |
Closes #100
Summary
Extend
mark_stale_results_failed()to set proper error message andcompleted_aton orphanedpending/runningjobs during server startup.Changes
storage.py: Newerrorcolumn migration. Module-levelORPHAN_STATUSESandRESTART_ERROR_MSGconstants.mark_stale_results_failed()returns(waiting_jobs, recovered_jobs)tuple, sets error + completed_at on all failed rows. Dashboard and detail views exposeerrorfield.main.py: Per-job INFO log for recovered orphaned jobs.3 files, +82/-22 lines. All tests pass.