Maor Lipchuk has posted comments on this change.

Change subject: core: Execute clear tasks with new thread.
......................................................................


Patch Set 1:

(5 comments)

http://gerrit.ovirt.org/#/c/23724/1//COMMIT_MSG
Commit Message:

Line 7: core: Execute clear tasks with new thread.
Line 8: 
Line 9: clearAsyncTasksWithOutVdsmId is executed at the finally step when
Line 10: executing a vdc command.
Line 11: If the execute phase encountered a problem, the engine roll backs the 
transaction
> the transaction is set to "rollback only", that's the term that should be u
It sounds ok to me, please give a specific alternative and I will change it
Line 12: and we can not use it any more.
Line 13: Since the clearAsyncTasksWithOutVdsmId uses calls to the DB, the engine
Line 14: throws a non-transaction exception, and the original exception does not
Line 15: flow to the user.


Line 10: executing a vdc command.
Line 11: If the execute phase encountered a problem, the engine roll backs the 
transaction
Line 12: and we can not use it any more.
Line 13: Since the clearAsyncTasksWithOutVdsmId uses calls to the DB, the engine
Line 14: throws a non-transaction exception, and the original exception does not
> the exception should be TransactionSetRollbackOnly or something like that i
non-transactive exception makes sense IMHO, I don't mind changing it though...
Line 15: flow to the user.
Line 16: 
Line 17: The proposed solution is to clear the async tasks with a new
Line 18: transaction, so it will not be dependent on the related execute phase.


http://gerrit.ovirt.org/#/c/23724/1/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java:

Line 361:         return getReturnValue();
Line 362:     }
Line 363: 
Line 364:     private void clearAsyncTasksWithOutVdsmId() {
Line 365:         if (getReturnValue().getTaskPlaceHolderIdList().size() > 0) {
> please change to isEmpty
done
Line 366:             TransactionSupport.executeInNewTransaction(new 
TransactionMethod<Object>() {
Line 367:                 @Override
Line 368:                 public Void runInTransaction() {
Line 369:                     for (final Guid asyncTaskId : 
getReturnValue().getTaskPlaceHolderIdList()) {


Line 363: 
Line 364:     private void clearAsyncTasksWithOutVdsmId() {
Line 365:         if (getReturnValue().getTaskPlaceHolderIdList().size() > 0) {
Line 366:             TransactionSupport.executeInNewTransaction(new 
TransactionMethod<Object>() {
Line 367:                 @Override
> should be  TransactionMethod<Void>
done
Line 368:                 public Void runInTransaction() {
Line 369:                     for (final Guid asyncTaskId : 
getReturnValue().getTaskPlaceHolderIdList()) {
Line 370:                         AsyncTasks task = 
getAsyncTaskDao().get(asyncTaskId);
Line 371:                         if (task != null && 
Guid.isNullOrEmpty(task.getVdsmTaskId())) {


Line 365:         if (getReturnValue().getTaskPlaceHolderIdList().size() > 0) {
Line 366:             TransactionSupport.executeInNewTransaction(new 
TransactionMethod<Object>() {
Line 367:                 @Override
Line 368:                 public Void runInTransaction() {
Line 369:                     for (final Guid asyncTaskId : 
getReturnValue().getTaskPlaceHolderIdList()) {
> final is unneeded
done
Line 370:                         AsyncTasks task = 
getAsyncTaskDao().get(asyncTaskId);
Line 371:                         if (task != null && 
Guid.isNullOrEmpty(task.getVdsmTaskId())) {
Line 372:                             
AsyncTaskManager.removeTaskFromDbByTaskId(task.getTaskId());
Line 373:                         }


-- 
To view, visit http://gerrit.ovirt.org/23724
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I3434c2dbd605e741b2cfbbede8c4a120f21ca9fe
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Liron Ar <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Ravi Nori <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: mooli tayer <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to