[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-8078?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14250506#comment-14250506
 ] 

ASF subversion and git services commented on CLOUDSTACK-8078:
-------------------------------------------------------------

Commit 74720830cdfa3a376682f43c375e834bdb81052d in cloudstack's branch 
refs/heads/master from [~prachidamle]
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=7472083 ]

CLOUDSTACK-8078: [Automation] Deletion of Affinity Groups - 
CloudRuntimeException: No Event Pubish can be wrapped within DB Transaction!

Changes:
-     The event of deleteing an affinity group is published on the MessageBus 
so that IAM Service can listen and process the event, However the publish 
operation should not be handled within a DB transaction, since it may take 
longer and hold the DB transaction for long unnecessarily
-    Publish any events to MessageBus outside of the transaction


> [Automation] Deletion of Affinity Groups - CloudRuntimeException: No Event 
> Pubish can be wrapped within DB Transaction!
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-8078
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-8078
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>          Components: Automation, Management Server
>    Affects Versions: 4.5.0
>            Reporter: Prachi Damle
>            Assignee: Prachi Damle
>            Priority: Critical
>             Fix For: 4.5.0
>
>
> See error during deleteAffinityGroup
> ====================
> CloudRuntimeException:
> ====================
> 2014-12-14 18:29:51,636 INFO  [o.a.c.f.j.i.AsyncJobMonitor] 
> (API-Job-Executor-37:ctx-61c26d76 job-485) (logid:82f62d53) Add job-485 into 
> job monitoring
> 2014-12-14 18:29:51,641 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] 
> (catalina-exec-25:ctx-e231fbde ctx-25d0c1ac ctx-18c538f9) (logid:78eae0c5) 
> submit async job-485, details: AsyncJobVO {id:485, userId: 2, accountId: 2, 
> instanceType: AffinityGroup, instanceId: null, cmd: 
> org.apache.cloudstack.api.command.user.affinitygroup.DeleteAffinityGroupCmd, 
> cmdInfo: 
> {"response":"json","id":"319dc948-606c-4045-81a3-1fd385fb12c1","ctxDetails":"{\"org.apache.cloudstack.affinity.AffinityGroup\":\"319dc948-606c-4045-81a3-1fd385fb12c1\"}","cmdEventType":"AG.DELETE","ctxUserId":"2","httpmethod":"GET","uuid":"319dc948-606c-4045-81a3-1fd385fb12c1","ctxAccountId":"2","ctxStartEventId":"1705","apiKey":"lA1vMT9CPy47zN3KD8yIgNWohJMRRXquiiQuvhThpUBpW5g6HsFxn_fEKQwLDnlrYUtNeATQsr8psheiAaBAcg","signature":"Oc6n9ljuRmBDy9KAh5ZgO1sEP/k\u003d"},
>  cmdVersion: 0, status: IN_PROGRESS, processStatus: 0, resultCode: 0, result: 
> null, initMsid: 94761346572491, completeMsid: null, lastUpdated: null, 
> lastPolled: null, created: null}
> 2014-12-14 18:29:51,641 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] 
> (API-Job-Executor-37:ctx-61c26d76 job-485) (logid:59ee6d42) Executing 
> AsyncJobVO {id:485, userId: 2, accountId: 2, instanceType: AffinityGroup, 
> instanceId: null, cmd: 
> org.apache.cloudstack.api.command.user.affinitygroup.DeleteAffinityGroupCmd, 
> cmdInfo: 
> {"response":"json","id":"319dc948-606c-4045-81a3-1fd385fb12c1","ctxDetails":"{\"org.apache.cloudstack.affinity.AffinityGroup\":\"319dc948-606c-4045-81a3-1fd385fb12c1\"}","cmdEventType":"AG.DELETE","ctxUserId":"2","httpmethod":"GET","uuid":"319dc948-606c-4045-81a3-1fd385fb12c1","ctxAccountId":"2","ctxStartEventId":"1705","apiKey":"lA1vMT9CPy47zN3KD8yIgNWohJMRRXquiiQuvhThpUBpW5g6HsFxn_fEKQwLDnlrYUtNeATQsr8psheiAaBAcg","signature":"Oc6n9ljuRmBDy9KAh5ZgO1sEP/k\u003d"},
>  cmdVersion: 0, status: IN_PROGRESS, processStatus: 0, resultCode: 0, result: 
> null, initMsid: 94761346572491, completeMsid: null, lastUpdated: null, 
> lastPolled: null, created: null}
> 2014-12-14 18:29:51,641 DEBUG [c.c.a.ApiServlet] 
> (catalina-exec-25:ctx-e231fbde ctx-25d0c1ac ctx-18c538f9) (logid:78eae0c5) 
> ===END===  10.81.29.18 -- GET  
> id=319dc948-606c-4045-81a3-1fd385fb12c1&apiKey=lA1vMT9CPy47zN3KD8yIgNWohJMRRXquiiQuvhThpUBpW5g6HsFxn_fEKQwLDnlrYUtNeATQsr8psheiAaBAcg&command=deleteAffinityGroup&response=json&signature=Oc6n9ljuRmBDy9KAh5ZgO1sEP%2Fk%3D
> 2014-12-14 18:29:51,646 DEBUG [c.c.a.ApiServlet] 
> (catalina-exec-4:ctx-b127c144) (logid:fb950f22) ===START===  10.81.29.18 -- 
> GET  
> jobid=59ee6d42-9964-4e99-86e5-cd83ace8c0a2&apiKey=lA1vMT9CPy47zN3KD8yIgNWohJMRRXquiiQuvhThpUBpW5g6HsFxn_fEKQwLDnlrYUtNeATQsr8psheiAaBAcg&command=queryAsyncJobResult&response=json&signature=4tcHbecYJkvrJxVV00AJe2HShXc%3D
> 2014-12-14 18:29:51,663 DEBUG [c.c.a.ApiServlet] 
> (catalina-exec-4:ctx-b127c144 ctx-a6c508cb ctx-65259123) (logid:fb950f22) 
> ===END===  10.81.29.18 -- GET  
> jobid=59ee6d42-9964-4e99-86e5-cd83ace8c0a2&apiKey=lA1vMT9CPy47zN3KD8yIgNWohJMRRXquiiQuvhThpUBpW5g6HsFxn_fEKQwLDnlrYUtNeATQsr8psheiAaBAcg&command=queryAsyncJobResult&response=json&signature=4tcHbecYJkvrJxVV00AJe2HShXc%3D
> 2014-12-14 18:29:51,665 ERROR [o.a.c.f.m.MessageBusBase] 
> (API-Job-Executor-37:ctx-61c26d76 job-485 ctx-f17ad124) (logid:59ee6d42) NO 
> EVENT PUBLISH CAN BE WRAPPED WITHIN DB TRANSACTION!
> com.cloud.utils.exception.CloudRuntimeException: NO EVENT PUBLISH CAN BE 
> WRAPPED WITHIN DB TRANSACTION!
>       at 
> org.apache.cloudstack.framework.messagebus.MessageBusBase.publish(MessageBusBase.java:167)
>       at 
> org.apache.cloudstack.affinity.AffinityGroupServiceImpl$2.doInTransactionWithoutResult(AffinityGroupServiceImpl.java:304)
>       at 
> com.cloud.utils.db.TransactionCallbackNoReturn.doInTransaction(TransactionCallbackNoReturn.java:25)
>       at com.cloud.utils.db.Transaction$2.doInTransaction(Transaction.java:57)
>       at com.cloud.utils.db.Transaction.execute(Transaction.java:45)
>       at com.cloud.utils.db.Transaction.execute(Transaction.java:54)
>       at 
> org.apache.cloudstack.affinity.AffinityGroupServiceImpl.deleteAffinityGroup(AffinityGroupServiceImpl.java:269)
>       at sun.reflect.GeneratedMethodAccessor375.invoke(Unknown Source)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:601)
>       at 
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
>       at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
>       at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
>       at 
> org.apache.cloudstack.network.contrail.management.EventUtils$EventInterceptor.invoke(EventUtils.java:106)
>       at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
>       at 
> com.cloud.event.ActionEventInterceptor.invoke(ActionEventInterceptor.java:51)
>       at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
>       at 
> org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
>       at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
>       at 
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
>       at $Proxy203.deleteAffinityGroup(Unknown Source)
>       at 
> org.apache.cloudstack.api.command.user.affinitygroup.DeleteAffinityGroupCmd.execute(DeleteAffinityGroupCmd.java:134)
>       at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:141)
>       at 
> com.cloud.api.ApiAsyncJobDispatcher.runJob(ApiAsyncJobDispatcher.java:108)
>       at 
> org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.runInContext(AsyncJobManagerImpl.java:547)
>       at 
> org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:49)
>       at 
> org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:56)
>       at 
> org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:103)
>       at 
> org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:53)
>       at 
> org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:46)
>       at 
> org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.run(AsyncJobManagerImpl.java:498)
>       at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>       at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
>       at java.util.concurrent.FutureTask.run(FutureTask.java:166)
>       at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>       at java.lang.Thread.run(Thread.java:722)
> 2014-12-14 18:29:51,676 DEBUG [o.a.c.a.AffinityGroupServiceImpl] 
> (API-Job-Executor-37:ctx-61c26d76 job-485 ctx-f17ad124) (logid:59ee6d42) 
> Deleted affinity group id=43
> 2014-12-14 18:29:51,682 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] 
> (API-Job-Executor-37:ctx-61c26d76 job-485 ctx-f17ad124) (logid:59ee6d42) 
> Complete async job-485, jobStatus: SUCCEEDED, resultCode: 0, result: 
> org.apache.cloudstack.api.response.SuccessResponse/null/{"success":true}
> 2014-12-14 18:29:51,683 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] 
> (API-Job-Executor-37:ctx-61c26d76 job-485 ctx-f17ad124) (logid:59ee6d42) 
> Publish async job-485 complete on message bus
> 2014-12-14 18:29:51,683 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] 
> (API-Job-Executor-37:ctx-61c26d76 job-485 ctx-f17ad124) (logid:59ee6d42) Wake 
> up jobs related to job-485
> 2014-12-14 18:29:51,683 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] 
> (API-Job-Executor-37:ctx-61c26d76 job-485 ctx-f17ad124) (logid:59ee6d42) 
> Update db status for job-485
> 2014-12-14 18:29:51,684 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] 
> (API-Job-Executor-37:ctx-61c26d76 job-485 ctx-f17ad124) (logid:59ee6d42) Wake 
> up jobs joined with job-485 and disjoin all subjobs created from job- 485
> 2014-12-14 18:29:51,693 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl] 
> (API-Job-Executor-37:ctx-61c26d76 job-485) (logid:59ee6d42) Done executing 
> org.apache.cloudstack.api.command.user.affinitygroup.DeleteAffinityGroupCmd 
> for job-485
> 2014-12-14 18:29:51,693 INFO  [o.a.c.f.j.i.AsyncJobMonitor] 
> (API-Job-Executor-37:ctx-61c26d76 job-485) (logid:59ee6d42) Remove job-485 
> from job monitoring



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to