-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Force stop command deletes all jobs if the kubernetes job no longer exists #3750
Comments
I was just thinking about this and I am pretty sure the steps to reproduce are easily achieved:
The first call to stop deletes the all of the resources related to that |
While resolving this issue I ran into some other problems:
|
Useful links:
|
In certain scenarios calling force delete on a pod will not actually delete the process immediately.
Delay is used here to keep the slice from finishing, preventing the shutdown process from completing until the delay ends.
|
This PR makes the following changes: - Ensure that `K8s._deleteObjByExId()` contains an object in `objList.items[]` before calling `K8s.deleted()`. - Throw if `K8s.delete()` receives a `name` argument that is undefined or an empty string. - Refactor `K8s._deleteObjByExId()` to delete multiple objects and not handle `force logic` - Refactor `k8s.deleteExecution() to handle `force` logic by calling `K8s._deleteObjByExId()` on multiple resources. - bump teraslice from version 2.3.1 to 2.3.2 - pin the kind image used by k8s to: `kindest/node:v1.28.12@sha256:fa0e48b1e83bb8688a5724aa7eebffbd6337abd7909ad089a2700bf08c30c6ea`. Note that the version in the image tag refers to the kubernetes server version that will be used. We should keep this in sync with prod. ref: #3750
Here is a simpler reproduction:
|
This should be resolved. Closing. |
When force deleting a job, there is a possibility that the kubernetes job resource has been deleted, while there are other resources (pods, services, deployments) that have been orphaned. In this case
K8s._deleteObjByExId()
will receiveundefined
as thename
of the job resource. TheK8s.delete()
function usesname
to select which jobs to delete. If passedundefined
or an empty string it will return ALL job resources and then delete them.K8s.delete()
needs to ensure thatname
is defined and not an empty string.K8s._deleteObjByExId()
must ensure there is a resource to delete before callingdelete()
.This bug is only in kubernetes clustering, as kubernetesV2 receives a typed object when looking up the job resource, and therefore already checks whether name is defined.
The text was updated successfully, but these errors were encountered: