-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
control-service: bugfix on the execution cancellation api (#215)
why: During testing, when making calls to the endpoint I noticed that the job execution state would get overriden by the control service. The cancel functionality would execute and set the status of the execution to cancelled, but then it would get overriden by the DataJobStatusMonitor functionality. Also as a user if I try to cancel an execution in running state which is no longer present in K8S and the API returns 404 (job not found) we would return an error and the execution would still be in running state. Refactored the updateJobExecution method. Decided against updating the status of job executions with a completed state (Finished, Skipped, Cancelled, Failed). what: Added a check in the update method which checks if the execution is in completed and if it is, don't update it. Added another check in the K8S call to check if the API returns 404. If it does, we mark the execution as cancelled in the database. Added unit tests. Changed a unit test because it was trying to update an execution in a completed state (Finished) to Running. type: Bugfix testing: CI/CD, ran tests locally, added/updated tests Signed-off-by: Momchil Zhivkov [email protected]
- Loading branch information
Momchil Z
authored
Sep 16, 2021
1 parent
f04a309
commit 2b304d8
Showing
4 changed files
with
150 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters