Bug 871802 - [engine-core] Null Pointer Exception when during “preview mode” action, service ovirt-engine restart (TryBackToAllSnapshotsOfVm threw an exception: java.lang.NullPointerException), and all disks VM enter to Locked state
[engine-core] Null Pointer Exception when during “preview mode” action, servi...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
3.1.0
x86_64 Linux
high Severity high
: ---
: 3.2.0
Assigned To: Yair Zaslavsky
Elad
infra
: ZStream
Depends On:
Blocks: 915537 949680
  Show dependency treegraph
 
Reported: 2012-10-31 08:41 EDT by vvyazmin@redhat.com
Modified: 2016-02-10 14:38 EST (History)
19 users (show)

See Also:
Fixed In Version: sf7
Doc Type: Bug Fix
Doc Text:
Compensation when unlocking a virtual machine was performed on each virtual machine, but the defined data access object (DAO) for compensation status updates is mapped dynamically per virtual machine. This caused NullPointerException errors when accessing disk snapshots. Compensation is now performed on the virtual machine's dynamic data, so previewing snapshots does not yield NPE errors.
Story Points: ---
Clone Of:
: 949680 (view as bug list)
Environment:
Last Closed: 2013-06-10 17:15:57 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Infra
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
## Logs rhevm (411.65 KB, application/x-gzip)
2012-10-31 08:41 EDT, vvyazmin@redhat.com
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 318733 None None None Never
oVirt gerrit 11828 None None None Never
oVirt gerrit 9074 None None None Never

  None (edit)
Description vvyazmin@redhat.com 2012-10-31 08:41:59 EDT
Created attachment 636110 [details]
## Logs rhevm

Description of problem: Get a Null Pointer Exception when during “preview mode” action, service ovirt-engine restart (TryBackToAllSnapshotsOfVm threw an exception: java.lang.NullPointerException), and all disks VM enter to Locked state


Version-Release number of selected component (if applicable):
RHEVM 3.1 - SI22

RHEVM: rhevm-3.1.0-22.el6ev.noarch
VDSM: vdsm-4.9.6-39.0.el6_3.x86_64
LIBVIRT: libvirt-0.9.10-21.el6_3.5.x86_64
QEMU & KVM: qemu-kvm-rhev-0.12.1.2-2.295.el6_3.2.x86_64
SANLOCK: sanlock-2.3-4.el6_3.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Create VM win 3 IDE disk, and Windows OS installed
2. Power-On VM
3. Create a Live-Snapshot 
4. Power off VM
5. Select a snapshot and run “preview” action
6. During “preview mode” action, restart “ovirt-engine” service on RHEVM machine.
  
Actual results:
All disks VM enter to Locked state
RHEVM enter to loop “NullPointerException”

Expected results:
If there is a task in the backend it should be finished succusfully.
If there were no task created, it should be reverted. 

Additional info:

2012-10-31 13:23:52,893 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.GetImageInfoVDSCommand] (pool-4-thread-48) [609a6407] START, GetImageInfoVDSCommand( storagePoolId = 745
5040b-1fe6-4434-95a4-57cab522d76e, ignoreFailoverLimit = false, compatabilityVersion = null, storageDomainId = 8f81428c-612d-4f01-a834-aa7fff4e9485, imageGroupId = 07b49ad2-1677
-43e0-b068-4e43c930b458, imageId = e7cb32a8-5634-4f7c-9844-9827c4a94809), log id: 62022323
2012-10-31 13:23:53,387 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.GetImageInfoVDSCommand] (pool-4-thread-48) [609a6407] FINISH, GetImageInfoVDSCommand, return: org.ovirt.
engine.core.common.businessentities.DiskImage@c58bff99, log id: 62022323
2012-10-31 13:23:53,424 INFO  [org.ovirt.engine.core.bll.TryBackToSnapshotCommand] (pool-4-thread-48) [790bfdff] Ending command successfully: org.ovirt.engine.core.bll.TryBackTo
SnapshotCommand
2012-10-31 13:23:53,437 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.GetImageInfoVDSCommand] (pool-4-thread-48) [790bfdff] START, GetImageInfoVDSCommand( storagePoolId = 745
5040b-1fe6-4434-95a4-57cab522d76e, ignoreFailoverLimit = false, compatabilityVersion = null, storageDomainId = 8f81428c-612d-4f01-a834-aa7fff4e9485, imageGroupId = 45d703e2-4215
-4c7f-b92b-81df52835508, imageId = ca766a89-5e04-4a73-99a4-94c4b5c260e7), log id: 792095b8
2012-10-31 13:23:53,917 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.GetImageInfoVDSCommand] (pool-4-thread-48) [790bfdff] FINISH, GetImageInfoVDSCommand, return: org.ovirt.
engine.core.common.businessentities.DiskImage@14b2928c, log id: 792095b8
2012-10-31 13:23:54,077 INFO  [org.ovirt.engine.core.vdsbroker.SetVmStatusVDSCommand] (pool-4-thread-48) START, SetVmStatusVDSCommand( vmId = 3f3dd756-6ade-46a3-b3e0-84381efd780
0, status = Down), log id: bec4752
2012-10-31 13:23:54,098 INFO  [org.ovirt.engine.core.vdsbroker.SetVmStatusVDSCommand] (pool-4-thread-48) FINISH, SetVmStatusVDSCommand, log id: bec4752
2012-10-31 13:23:54,120 INFO  [org.ovirt.engine.core.utils.transaction.TransactionSupport] (pool-4-thread-48) transaction rolled back
2012-10-31 13:23:54,137 INFO  [org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand] (pool-4-thread-48) Command [id=d37ce162-c8d9-4056-862e-3d8ae4ffb14b]: Compensating CHA
NGED_STATUS_ONLY of org.ovirt.engine.core.common.businessentities.VM; snapshot: EntityStatusSnapshot [id=3f3dd756-6ade-46a3-b3e0-84381efd7800, status=ImageLocked].
2012-10-31 13:23:54,138 INFO  [org.ovirt.engine.core.utils.transaction.TransactionSupport] (pool-4-thread-48) transaction rolled back
2012-10-31 13:23:54,142 INFO  [org.ovirt.engine.core.utils.transaction.TransactionSupport] (pool-4-thread-48) transaction rolled back
2012-10-31 13:23:54,172 ERROR [org.ovirt.engine.core.bll.EntityAsyncTask] (pool-4-thread-48) EntityAsyncTask::EndCommandAction [within thread]: EndAction for action type TryBack
ToAllSnapshotsOfVm threw an exception: java.lang.NullPointerException
        at java.util.concurrent.ConcurrentHashMap.hash(ConcurrentHashMap.java:332) [rt.jar:1.7.0_09-icedtea]
        at java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.java:1015) [rt.jar:1.7.0_09-icedtea]
        at org.ovirt.engine.core.dao.DaoFactory.get(DaoFactory.java:16) [engine-dal.jar:]
        at org.ovirt.engine.core.dal.dbbroker.DbFacade.getDAO(DbFacade.java:185) [engine-dal.jar:]
        at org.ovirt.engine.core.dal.dbbroker.DbFacade.getDaoForEntity(DbFacade.java:181) [engine-dal.jar:]
        at org.ovirt.engine.core.bll.CommandBase$1.runInTransaction(CommandBase.java:347) [engine-bll.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction(TransactionSupport.java:204) [engine-utils.jar:]
        at org.ovirt.engine.core.bll.CommandBase.compensate(CommandBase.java:326) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.endActionInTransactionScope(CommandBase.java:466) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.runInTransaction(CommandBase.java:1302) [engine-bll.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction(TransactionSupport.java:204) [engine-utils.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInRequired(TransactionSupport.java:142) [engine-utils.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope(TransactionSupport.java:109) [engine-utils.jar:]
        at org.ovirt.engine.core.bll.CommandBase.endAction(CommandBase.java:390) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.Backend.endAction(Backend.java:356) [engine-bll.jar:]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_09-icedtea]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_09-icedtea]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_09-icedtea]
        at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_09-icedtea]
        at org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72) [jboss-as-ee.jar:7.1.2.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:374) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.ovirt.engine.core.utils.ThreadLocalSessionCleanerInterceptor.injectWebContextToThreadLocal(ThreadLocalSessionCleanerInterceptor.java:11) [engine-utils.jar:]
        at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source) [:1.7.0_09-icedtea]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_09-icedtea]
        at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_09-icedtea]
        at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptorFactory$ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptorFactory.java:123) [jboss-as-ee.jar:7.1.2.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:36) [jboss-as-ee.jar:7.1.2.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43) [jboss-as-ejb3.jar:7.1.2.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53) [jboss-as-ee.jar:7.1.2.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.as.ejb3.component.singleton.SingletonComponentInstanceAssociationInterceptor.processInvocation(SingletonComponentInstanceAssociationInterceptor.java:53) [jboss-as-ejb3.jar:7.1.2.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInNoTx(CMTTxInterceptor.java:210) [jboss-as-ejb3.jar:7.1.2.Final-redhat-1]
        at org.jboss.as.ejb3.tx.CMTTxInterceptor.supports(CMTTxInterceptor.java:362) [jboss-as-ejb3.jar:7.1.2.Final-redhat-1]
        at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:193) [jboss-as-ejb3.jar:7.1.2.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3.jar:7.1.2.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:42) [jboss-as-ejb3.jar:7.1.2.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53) [jboss-as-ee.jar:7.1.2.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.as.ejb3.component.singleton.SingletonComponentInstanceAssociationInterceptor.processInvocation(SingletonComponentInstanceAssociationInterceptor.java:53) [jboss-as-ejb3.jar:7.1.2.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInNoTx(CMTTxInterceptor.java:210) [jboss-as-ejb3.jar:7.1.2.Final-redhat-1]
        at org.jboss.as.ejb3.tx.CMTTxInterceptor.supports(CMTTxInterceptor.java:362) [jboss-as-ejb3.jar:7.1.2.Final-redhat-1]
        at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:193) [jboss-as-ejb3.jar:7.1.2.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3.jar:7.1.2.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:42) [jboss-as-ejb3.jar:7.1.2.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3.jar:7.1.2.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee.jar:7.1.2.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee.jar:7.1.2.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) [jboss-as-ee.jar:7.1.2.Final-redhat-1]
        at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:176) [jboss-as-ee.jar:7.1.2.Final-redhat-1]
        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation.jar:1.1.1.Final-redhat-1]
        at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72) [jboss-as-ee.jar:7.1.2.Final-redhat-1]
        at org.ovirt.engine.core.bll.interfaces.BackendInternal$$$view9.endAction(Unknown Source) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.EntityAsyncTask.EndCommandAction(EntityAsyncTask.java:134) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.EntityAsyncTask.access$000(EntityAsyncTask.java:23) [engine-bll.jar:]
        at org.ovirt.engine.core.bll.EntityAsyncTask$1.run(EntityAsyncTask.java:104) [engine-bll.jar:]
        at org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil$InternalWrapperRunnable.run(ThreadPoolUtil.java:64) [engine-utils.jar:]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_09-icedtea]
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_09-icedtea]
        at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_09-icedtea]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_09-icedtea]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_09-icedtea]
        at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09-icedtea]

2012-10-31 13:23:43,638 INFO  [org.ovirt.engine.core.bll.EntityAsyncTask] (pool-4-thread-46) EntityAsyncTask::HandleEndActionResult [within thread]: EndAction for action type TryBackToAllSnapshotsOfVm completed, handling the result.
2012-10-31 13:23:43,638 INFO  [org.ovirt.engine.core.bll.EntityAsyncTask] (pool-4-thread-46) EntityAsyncTask::HandleEndActionResult [within thread]: EndAction for action type TryBackToAllSnapshotsOfVm hasnt succeeded, not clearing tasks, will attempt again next polling.



2012-10-31 14:11:55,119 INFO  [org.ovirt.engine.core.utils.transaction.TransactionSupport] (pool-4-thread-48) transaction rolled back
2012-10-31 14:11:55,121 INFO  [org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand] (pool-4-thread-48) Command [id=d37ce162-c8d9-4056-862e-3d8ae4ffb14b]: Compensating CHANGED_STATUS_ONLY of org.ovirt.engine.core.common.businessentities.VM; snapshot: EntityStatusSnapshot [id=3f3dd756-6ade-46a3-b3e0-84381efd7800, status=ImageLocked].
2012-10-31 14:11:55,121 INFO  [org.ovirt.engine.core.utils.transaction.TransactionSupport] (pool-4-thread-48) transaction rolled back
2012-10-31 14:11:55,122 INFO  [org.ovirt.engine.core.utils.transaction.TransactionSupport] (pool-4-thread-48) transaction rolled back
2012-10-31 14:11:55,718 ERROR [org.ovirt.engine.core.bll.EntityAsyncTask] (pool-4-thread-48) EntityAsyncTask::EndCommandAction [within thread]: EndAction for action type TryBackToAllSnapshotsOfVm threw an exception: java.lang.NullPointerException

2012-10-31 14:11:55,719 INFO  [org.ovirt.engine.core.bll.EntityAsyncTask] (pool-4-thread-48) EntityAsyncTask::HandleEndActionResult [within thread]: EndAction for action type TryBackToAllSnapshotsOfVm completed, handling the result.
2012-10-31 14:11:55,719 INFO  [org.ovirt.engine.core.bll.EntityAsyncTask] (pool-4-thread-48) EntityAsyncTask::HandleEndActionResult [within thread]: EndAction for action type TryBackToAllSnapshotsOfVm hasnt succeeded, not clearing tasks, will attempt again next polling.
Comment 1 Allon Mureinik 2012-11-12 08:59:26 EST
There is a WIP patch that solves this issue:
http://gerrit.ovirt.org/#/c/9073

Merging it is pending an engine-devel discussion as to what should be the /correct/ way to handle task bands.
Comment 2 Ayal Baron 2012-11-21 04:58:08 EST
Vlad, is this after VM enters preview mode? (i.e. operation completed successfully) or while the preview is being done? (creating the volumes on storage)?
Comment 5 Liron Aravot 2013-01-01 02:08:21 EST
Yair, the issue i the situation in which compensation is being done - as we discussed on the tasks meeting.

right now compensation will run on server startup regardless whether the tasks were initiated on vdsm, so endSuccesfully/endWithFailure can be called after compensation ran when all needed entities might have been deleted which will cause to NPE.

If we want to solve those bugs until all the tasks related issues that we discussed on the tasks meeting are cleared, the only mechanism that we have now for doing so is to check during end methods whether added entity was deleted during compensation to prevent NPE - which is the implemented solution.

basically we should decide in which way we want to go - if we want to solve those bugs, that's the solution . if we do not to solve in this way, all of those bugs should be dependent on the tasks related bugs and wait for the solution of 'missing tasks' and 'compensation with tasks'.
Comment 6 mkublin 2013-02-07 00:49:09 EST
http://gerrit.ovirt.org/#/c/11828/
The following change will solve a NullPointerException during execution of endSucessfully(). 
VM will not be left in status locked. Some of its disks can still left in status locked, solution for that problem is easy but I think that a different bug should be opened for it.
Regards comment 5, possible it is correct but is is not related to bug.
Comment 8 Liron Aravot 2013-02-07 03:49:39 EST
mkublin, I don't agree - I'll elaborate.

Your suggested patch fixes the serialization - 
I already fixed the serialization  in my patch to solve the issue, you can have a look there.
with the serialization fix only as you suggested - if the crash will be before compensation is cleaned (and when qa runs it it really might happen, as we create task for each image which is vdsm operation) we will have the same issue so this bug may be reopened after your suggested patch.

so basically my patch solved those two issues, crash before compensation clears and crash after compensation clears, your suggested patch solves an issue that was already solved in the original patch and doesn't solve the other issue so the bug might be reopened and reproduce.

btw- i've also fixed two further issues that were in that command in different patches.
Comment 9 mkublin 2013-02-07 04:11:49 EST
(In reply to comment #8)
> mkublin, I don't agree - I'll elaborate.
> 
> Your suggested patch fixes the serialization - 
> I already fixed the serialization  in my patch to solve the issue, you can
> have a look there.
> with the serialization fix only as you suggested - if the crash will be
> before compensation is cleaned (and when qa runs it it really might happen,
> as we create task for each image which is vdsm operation) we will have the
> same issue so this bug may be reopened after your suggested patch.
> 
> so basically my patch solved those two issues, crash before compensation
> clears and crash after compensation clears, your suggested patch solves an
> issue that was already solved in the original patch and doesn't solve the
> other issue so the bug might be reopened and reproduce.
> 
> btw- i've also fixed two further issues that were in that command in
> different patches.

Liron , first of all what is not in gerrit - doesn't exist.
Second, Liron I don't like to chase a unicorns, I think that they don't exist
Comment 10 Liron Aravot 2013-02-07 04:21:49 EST
Michael, it is in gerrit - I already provided the link in this thread when i submitted the patch, you can take a look.

I don't agree with the term "chasing a unicorn" here,  this is a bug about crash during the command execution, my patch solved it and contained also your fix- now the bug can be reproduced and reopened if you crash during the command.
Comment 11 mkublin 2013-02-07 04:33:31 EST
(In reply to comment #10)
> Michael, it is in gerrit - I already provided the link in this thread when i
> submitted the patch, you can take a look.
> 
> I don't agree with the term "chasing a unicorn" here,  this is a bug about
> crash during the command execution, my patch solved it and contained also
> your fix- now the bug can be reproduced and reopened if you crash during the
> command.

You don't solve anything, you tried to make work around with thing that not related and you tried to solve an issues that doesn't exists.
Serialization issue was not solved and I don't know any reason for that.
Now, regards a bug, like I wrote after that patch the disk can still be left in status locked and fix for these I will send later and I like I wrote I think that for that issue should be opened a new bug.
By the way, solution for disks left in status locked in completely different direction from your patch.
Now, regards "I don't agree with the term" - I don't care.
Also Liron, please stop to write responses to bug, these is not twitter or facebook, after that really difficult to understand what was a problem
Comment 12 Liron Aravot 2013-02-07 05:14:18 EST
serialization issue has been fixed and contained, crash during execution was handled.
Regarding other issues that might be related - when i look at the patch, it is marked as WIP and also not as verified, meaning i didn't get to complete the solution to it because the bug was moved from me due to the objection to this part of the solution - let's finish the talk as there's no need to flood the bug thread - the most important thing is that it will work fine.

thanks, Liron.
Comment 15 Barak 2013-02-11 06:14:28 EST
Conclusion of the above long discussion:

There were 3 issues that were involved:
1. wrong compensation object was used - was merged upstream(9704) and 
   downstream(5362)
2. deserialization of one of the command parameters - was merged upstream (11828) 
   and still needs to be posted & merged downstream
3. The Disks on some situations still stays locked - We have opened Bug 909694 
   (storage) on the issue 
   however we think that bug will be solved when Bug 873546 (infra) will be 
   handled.

For now till #3 will be solved that way or the other, one can use the unlock utility


Once #2 above is merged downstream we'll move this BZ to ON_QA
Comment 16 Yair Zaslavsky 2013-02-11 23:02:42 EST
(In reply to comment #15)
> Conclusion of the above long discussion:
> 
> There were 3 issues that were involved:
> 1. wrong compensation object was used - was merged upstream(9704) and 
>    downstream(5362)
> 2. deserialization of one of the command parameters - was merged upstream
> (11828) 
>    and still needs to be posted & merged downstream
> 3. The Disks on some situations still stays locked - We have opened Bug
> 909694 
>    (storage) on the issue 
>    however we think that bug will be solved when Bug 873546 (infra) will be 
>    handled.
> 
> For now till #3 will be solved that way or the other, one can use the unlock
> utility
> 
> 
> Once #2 above is merged downstream we'll move this BZ to ON_QA

Downstream patch is provided,
Bug should be now fully acked.
Comment 24 Elad 2013-04-02 05:52:29 EDT
Verified on SF12. after restart to ovirt-engine during preview action to snapshot, disks are in ok.
Comment 27 Yair Zaslavsky 2013-04-09 05:53:56 EDT
(In reply to comment #24)
> Verified on SF12. after restart to ovirt-engine during preview action to
> snapshot, disks are in ok.
 I just talked with Elad, the disks were remain locked.
Per comment #15 we agreed that for this bug - this is fine.
Comment 29 errata-xmlrpc 2013-06-10 17:15:57 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-0888.html

Note You need to log in before you can comment on or make changes to this bug.