[ https://issues.apache.org/jira/browse/CLOUDSTACK-9195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15104156#comment-15104156 ]
ASF GitHub Bot commented on CLOUDSTACK-9195: -------------------------------------------- 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. > Cancelled/failed async jobs not getting cleaned up from DB > ---------------------------------------------------------- > > Key: CLOUDSTACK-9195 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9195 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: Management Server > Affects Versions: 4.6.0, 4.7.0 > Reporter: Koushik Das > Assignee: Koushik Das > Fix For: 4.8.0 > > > Some cancelled/failed async jobs are not getting cleaned up from DB even > after "job.expire.minutes". These jobs are marked as cancelled/failed when MS > is restarted, check for 'job_status' as 2 (FAILED) and 'job_result' as "job > cancelled because of management server restart or shutdown" in async_job > table in DB. These are not getting cleaned as 'job_complete_msid' field is > not set in DB. -- This message was sent by Atlassian JIRA (v6.3.4#6332)