...
- pre validation errors will not result in any download and hence no cleanup is required.
- post validation errors, template/volume will be cleaned
- http errors shall be caught in the appropriate events and the partially downloaded file will be cleaned.
- application errors and interruptions: existing template/volume sync will handle these when the SSVM is restarted. (TODO: add ref to the documentation of tempalte/volume sync)a new thread UploadToStorageGarbageCollector will be run periodically(based on a global configuration). It will look at any template/volume which are not deleted and in UPLOAD_ERROR state and send a DeleteCommand to the Agent for the same. It will also update the status of the template/volume to be deleted.
recovery mechanisms
There isnt any recovery or retry mechanism as this is a POST request. Once errored, template/volume will remain in the error state and admin will be able to troubleshoot it based on the appropriate log messages in management server log, agent log, apache access/error log files.
...