You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues and found none.
Problem Statement
In src/codegraphcontext/core/jobs.py, the JobStatus enum has a CANCELLED status defined but there is no cancel_job() method in the JobManager class to actually use it. This means once a job is started it cannot be cancelled programmatically.
Proposed Solution
Add a cancel_job() method to JobManager that sets the job status to JobStatus.CANCELLED and sets the end_time. This is thread-safe using the existing self.lock pattern.
Example:
def cancel_job(self, job_id: str) -> bool:
with self.lock:
if job_id in self.jobs:
job = self.jobs[job_id]
if job.status in [JobStatus.PENDING, JobStatus.RUNNING]:
job.status = JobStatus.CANCELLED
job.end_time = datetime.now()
return True
return False
Benefits
Allows users to cancel long-running indexing jobs
Makes use of the existing CANCELLED status that is currently unused
Consistent with the existing thread-safe pattern in JobManager
Record
I agree to follow this project's Code of Conduct
I want to work on this issue
A status-only cancel_job() would be overwritten by ongoing indexing and would not stop work. Keep this open for cooperative cancellation checks in both pipelines and tests that terminal CANCELLED jobs cannot become COMPLETED.
Activity
github-actions commentedon Jun 13, 2026
Hi! 👋 Join our CodeGraphContext Discord channel to collaborate: https://discord.gg/dR4QY32uYQ
Shashankss1205 commentedon Oct 15, 2026
Maintenance review — 15 October 2026
A status-only cancel_job() would be overwritten by ongoing indexing and would not stop work. Keep this open for cooperative cancellation checks in both pipelines and tests that terminal CANCELLED jobs cannot become COMPLETED.