Github user koushik-das commented on the pull request: https://github.com/apache/cloudstack/pull/1272#issuecomment-172421544 @DaanHoogland Thanks for reviewing the code. On MS shutdown/restart the incomplete job entry will always get marked as cancelled in DB. You are right that an async job might continue to run even after MS shutdown. For e.g. MS is stopped in middle of deploy VM operation. If the command to deploy VM has reached HV before MS stop, then it will get started. The DB will be synced to correct state based on vm sync once the MS is started again. For volume and other operations (snapshot etc.), there is no recovery in these scenarios. Something like storage sync needs to be implemented which can update DB state based on the actual content/state of primary and secondary storages.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---