Skip to content

Conversation

@BryonLewis
Copy link
Collaborator

The following is a small PR that would make it so live cancellation (clicking the Cancel button in the Job History) will work and will log that the job has been cancelled in the dive_job_manifest.json as well as the runlog.txt.

The main goal of this PR is to provide users with feedback and information that a job was cancelled.

DIVE-20251217-JobCancellation_small.mp4
  • Added to DesktopJob a new property cancelledJob that can be set when a job is cancelled
  • Swap to passing the full Job object to the IPCMain function instead of just the jobId. This was done so I could use the job.ts to updateHistory and add to the runlog a cancellation message as well as setting cancelledJob
  • updateHistory is modified so that if the cancelledJob is set it will stop other updates that may be happening
  • the job.ts now listens for a cancel-job event that can be set in the IPCMain handler to set a job to cancelled
  • added some utils.ts function to write the dive_job_manifest.json and the runlog.txt to indicate that a job was cancelled. This will be useful if we start reading in the folder the JobHistory and displaying it.
  • JobHistory.vue key is modified to that it ensures that when the cancelledJob or exitCode are updated it will update the page and display it.

@BryonLewis BryonLewis requested a review from naglepuff December 17, 2025 14:44
Copy link
Collaborator

@naglepuff naglepuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

My one thought is that maybe we should use 143 as the exit code for cancelled jobs. My understanding is that the convention is to use 128 + N, where N is the signal number. Since the code that kills the child processes uses SIGTERM, it would be 128 + 15.

I also think we should move this value into a constant somewhere, even if we keep -1.

@BryonLewis BryonLewis merged commit 9fb2d1a into issue-1456-cancel-jobs Dec 19, 2025
4 checks passed
@BryonLewis BryonLewis deleted the issue-1456-cancel-interface branch December 19, 2025 12:51
@BryonLewis
Copy link
Collaborator Author

I missed the constant message and merged too quick.

naglepuff added a commit that referenced this pull request Dec 19, 2025
* Add cancel job command to IPC service

* Add button to cancel in-flight jobs

* Add ability to remove jobs from queue

* Add UI for un-queueing jobs

* Live Cancellation Interface (#1561)

* live cancellation of jobs

* set exit code for cancelled jobs to 143

* add const cancelledJobExitCode

---------

Co-authored-by: Bryon Lewis <61746913+BryonLewis@users.noreply.github.com>
Co-authored-by: Bryon Lewis <Bryon.Lewis@kitware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants