Log cluster job_id on cancellation

- Show actual cluster job_id in cancellation log
- More informative logging with job_xxx format
- Consistent with assignment logging
parent 4e46e897
...@@ -73,18 +73,20 @@ class QueueManager: ...@@ -73,18 +73,20 @@ class QueueManager:
return False return False
# If job was processing, send cancel command to worker and clean up active job # If job was processing, send cancel command to worker and clean up active job
cancelled_job_id = None
if job['status'] == 'processing': if job['status'] == 'processing':
from vidai.cluster_master import cluster_master from vidai.cluster_master import cluster_master
for job_id, job_info in cluster_master.active_jobs.items(): for job_id, job_info in cluster_master.active_jobs.items():
if job_info.get('queue_id') == queue_id: if job_info.get('queue_id') == queue_id:
# Send cancel command to worker # Send cancel command to worker
cluster_master._cancel_job_processing(job_id) cluster_master._cancel_job_processing(job_id)
cancelled_job_id = job_id
break break
# Update status to cancelled # Update status to cancelled
update_queue_status(queue_id, 'cancelled') update_queue_status(queue_id, 'cancelled')
print(f"Job {queue_id} cancelled") print(f"Job {cancelled_job_id or queue_id} cancelled")
return True return True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment