Juan Hernandez has posted comments on this change.

Change subject: core: Locate data source in a loop
......................................................................


Patch Set 5: (1 inline comment)

....................................................
File 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/DbFacadeLocator.java
Line 82:                 Thread.sleep(checkInterval);
Line 83:             }
Line 84:             catch (InterruptedException exception) {
Line 85:                 log.warnFormat(
Line 86:                     "Interrupted while waiting for data source.", 
exception
In this particular case, if the thread ever happens to be interrupted, which is 
extremely unlikely, calling Thread.currentThread().interrupt() will set the 
interrupted flag again. That just sets the interrupted flag, it doesn't 
immediately stop any activity, only when the thread happens to call a method 
that checks this interrupted flag will activity be interrupted. In this case it 
could be any synchronization primitive, or IO method used in the body of the 
loop, but it could be the next call to Thread.sleep() as well, which will then 
throw the InterruptedException immediately. So the net effect could be that 
once interrupted the first time the loop body executes without any wait at all, 
consuming completely one CPU till the data source is deployed. All in all I 
think it is not worth doing any thing other than logging the interruption.
Line 87:                 );
Line 88:             }
Line 89:         }
Line 90: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I72c99c61d05e8a1619c7d1fb70af956d1050eb3a
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Barak Azulay <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Roy Golan <[email protected]>
Gerrit-Reviewer: Sandro Bonazzola <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to