Michael Kublin has posted comments on this change.

Change subject: core: throttle running of VMs (#843058)
......................................................................


Patch Set 5: (3 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommandBase.java
Line 51: 
Line 52:     private static Log log = LogFactory.getLog(RunVmCommandBase.class);
Line 53:     protected static final HashMap<Guid, Integer> 
_vds_pending_vm_count = new HashMap<Guid, Integer>();
Line 54:     protected final Lock decreaseLock = new ReentrantLock();
Line 55:     protected final Condition decreased = decreaseLock.newCondition();
when will we have cluster solution and how will it affect running a VM? - very 
simple , clustering mean more than one J2EE engine, I think it is clear why all 
internal locks should be in same place and not all around a code.
Second,   I am not introducing a "new" lock. just replaced the keyword 
"synchronized" with the lock object so I can have a Condition object. - Yes, 
you just continue to use same baggy code. How internal lock of object will 
solve a concurrency issue?
Line 56:     private VdsSelector privateVdsSelector;
Line 57:     protected boolean _isRerun = false;
Line 58:     protected VDS _destinationVds;
Line 59:     private SnapshotsValidator snapshotsValidator=new 
SnapshotsValidator();


Line 424:      * the DecreasePendingVms event.
Line 425:      * @see VdsEventListener
Line 426:      * @See VdsUpdateRunTimeInfo
Line 427:      */
Line 428:     @Override
Actually not. And waht about performance question? It is not important?
Line 429:     public void throttle(Guid vdsId) {
Line 430:         if (log.isDebugEnabled()) {
Line 431:             log.debug("try to wait for te engine update the host 
memory and cpu stats");
Line 432:         }


Line 439:                     
ResourceManager.getInstance().GetVdsManager(vdsId).getLastUpdateElapsed(),
Line 440:                     TimeUnit.SECONDS.toMillis(Config.<Integer> 
GetValue(VdsRefreshRate)));
Line 441:             t = Math.max(Config.<Integer> 
GetValue(ConfigValues.ThrottlerMaxWaitForVdsUpdateInMillis), t);
Line 442: 
Line 443:             // wait for the run-time refresh to decrease any current 
powering-up VMs
By the way, you understand that u will wait for nothing , if no one trying to 
do DecreasePendingVms()
Line 444:             decreased.await(t, TimeUnit.MILLISECONDS);
Line 445:         } catch (InterruptedException e) {
Line 446:             // ignore
Line 447:         } finally {


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I076ede6cba919bc61f7546d7b29ef436eb6d3375
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Roy Golan <rgo...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Barak Azulay <bazu...@redhat.com>
Gerrit-Reviewer: Doron Fediuck <dfedi...@redhat.com>
Gerrit-Reviewer: Michael Kublin <mkub...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com>
Gerrit-Reviewer: Roy Golan <rgo...@redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to