-
Story
-
Resolution: Unresolved
-
Normal
-
None
-
None
-
None
In webhooks we want to prevent failing requests when they are raceful.
Currently when creating the restore we check in the webhook a function called: validateSnapshot
1. we check that the snapshot exists. This is racy instead we should allow the restore to be created and show in the conditions that the snapshot doesnt exist yet.
2. I believe we should keep the get of the snapshot, return in case it doesnt exist, but if it exists we should check if the snapshot is in failed state since failed phase is permanent and no point in creating restore if snapshot is failed.
3. We should remove the check of 'readyToUse' since this state is changeable and racy.
4. And lastly in the same function we also check: sourceTargetVmsAreDifferent.
This is also racy since its possible that the target VM currently doesnt exist, but will exist a second later.