Author: justi9
Date: 2009-08-12 15:58:32 -0400 (Wed, 12 Aug 2009)
New Revision: 3573
Modified:
mgmt/trunk/mint/python/mint/model.py
Log:
Enlarge the scope of the locking in callMethod, to avoid handling method responses for
calls that are not yet registered
Modified: mgmt/trunk/mint/python/mint/model.py
===================================================================
--- mgmt/trunk/mint/python/mint/model.py 2009-08-12 19:10:39 UTC (rev 3572)
+++ mgmt/trunk/mint/python/mint/model.py 2009-08-12 19:58:32 UTC (rev 3573)
@@ -224,20 +224,17 @@
self.lock()
try:
broker = self.mintBrokersById[brokerId]
- finally:
- self.unlock()
- seq = self.qmfSession._sendMethodRequest \
- (broker.qmfBroker, ClassKey(classKey), objId, methodName, args)
+ seq = self.qmfSession._sendMethodRequest \
+ (broker.qmfBroker, ClassKey(classKey), objId, methodName, args)
- if seq is not None:
- self.lock()
- try:
+ if seq is not None:
self.outstandingMethodCalls[seq] = callback
- finally:
- self.unlock()
- return seq
+ return seq
+ finally:
+ self.unlock()
+
def addBroker(self, url):
log.info("Adding qmf broker at %s", url)
Show replies by date