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.
Hi all! Hope to get more involved with the project over the next few weeks. Thought id start with some easier items.
Which issue does this PR close?
part of #265
Rationale for this change
What changes are included in this PR?
Moved grpc cancellation logic to
SchedulerState
so that it could be reused by the REST interface. Kept error handling behavior the same, but added a 404 return when canceling a job that doesn't exist.Are there any user-facing changes?
For any long running tasks, users can execute a PATCH request on the job. for example:
curl -X PATCH -v -H 'Accept: application/json' http://localhost:50050/api/job/25UPl4w | jq
NOTE
When testing out this addition, I found that cancelling the job causes a few errors:
The scheduler always fails its grpc call to the executor to
cancel_tasks()
, and returns with anUnipmlemented
code. From looking at the executor logs, it doesn't seem to even reach them.The scheduler goes into an infinite loop
I think the bugs are unrelated. I'm happy to help debug, but I thought I'd post what I had since the changes are useful for debugging with
curl