Skip to content

Commit

Permalink
Fix abort for finished job
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaelvll committed Oct 27, 2023
1 parent 899f74b commit dcec696
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sky/api/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ async def abort(abort_body: RequestIdBody):
raise fastapi.HTTPException(
status_code=404,
detail=f'Request {abort_body.request_id} not found')
if rest_task.status > tasks.RequestStatus.RUNNING:
print(f'Request {abort_body.request_id} already finished')
return
rest_task.status = tasks.RequestStatus.ABORTED
if rest_task.pid is not None:
subprocess_utils.kill_children_processes(parent_pid=rest_task.pid)
Expand Down

0 comments on commit dcec696

Please sign in to comment.