[ovirt-devel] VDSM - sampling.py - remove() called without previous add()

Christopher Pereira kripper at imatronix.cl
Tue Apr 28 20:40:53 UTC 2015


Hi,

In sampling.py, remove() is being called without calling add() before, 
which throws:

    JsonRpc (StompReactor)::DEBUG::2015-04-28
    17:35:55,061::stompReactor::94::Broker.StompAdapter::(handle_frame)
    Handling message <StompFrame command=u'SEND'>
    Thread-37401::DEBUG::2015-04-28
    17:35:55,062::__init__::445::jsonrpc.JsonRpcServer::(_serveRequest)
    Calling 'VM.destroy' in bridge with {u'vmID':
    u'6ec9c0a0-2879-4bfe-9a79-92471881ebfe'}
    JsonRpcServer::DEBUG::2015-04-28
    17:35:55,062::__init__::482::jsonrpc.JsonRpcServer::(serve_requests)
    Waiting for request
    Thread-37401::INFO::2015-04-28
    17:35:55,062::API::334::vds::(destroy) vmContainerLock acquired by
    vm 6ec9c0a0-2879-4bfe-9a79-92471881ebfe
    Thread-37401::DEBUG::2015-04-28
    17:35:55,062::vm::3513::vm.Vm::(destroy)
    vmId=`6ec9c0a0-2879-4bfe-9a79-92471881ebfe`::destroy Called
    Thread-37401::INFO::2015-04-28
    17:35:55,062::vm::3444::vm.Vm::(releaseVm)
    vmId=`6ec9c0a0-2879-4bfe-9a79-92471881ebfe`::Release VM resources
    Thread-37401::WARNING::2015-04-28
    17:35:55,062::vm::375::vm.Vm::(_set_lastStatus)
    vmId=`6ec9c0a0-2879-4bfe-9a79-92471881ebfe`::trying to set state to
    Powering down when already Down
    Thread-37401::ERROR::2015-04-28
    17:35:55,063::__init__::469::jsonrpc.JsonRpcServer::(_serveRequest)
    Internal server error
    Traceback (most recent call last):
       File "/usr/lib/python2.7/site-packages/yajsonrpc/__init__.py",
    line 464, in _serveRequest
         res = method(**params)
       File "/usr/share/vdsm/rpc/Bridge.py", line 273, in _dynamicMethod
         result = fn(*methodArgs)
       File "/usr/share/vdsm/API.py", line 339, in destroy
         res = v.destroy()
       File "/usr/share/vdsm/virt/vm.py", line 3515, in destroy
         result = self.doDestroy()
       File "/usr/share/vdsm/virt/vm.py", line 3533, in doDestroy
         return self.releaseVm()
       File "/usr/share/vdsm/virt/vm.py", line 3448, in releaseVm
         sampling.stats_cache.remove(self.id)
       File "/usr/share/vdsm/virt/sampling.py", line 428, in remove
         if vmid in self._vm_last_timestamp.keys():
    KeyError: u'6ec9c0a0-2879-4bfe-9a79-92471881ebfe'
    Thread-37401::DEBUG::2015-04-28
    17:35:55,063::stompReactor::158::yajsonrpc.StompServer::(send)
    Sending response

In file '/usr/share/vdsm/virt/sampling.py':

     def add(self, vmid):
         """
         Warm up the cache for the given VM.
         This is to avoid races during the first sampling and the first
         reporting, which may result in a VM wrongly reported as 
unresponsive.
         """
         with self._lock:
             self._vm_last_timestamp[vmid] = self._clock()

     def remove(self, vmid):
         """
         Remove any data from the cache related to the given VM.
         """
         with self._lock:
*            if vmid in 
self._vm_last_timestamp.keys():**<----------------- I patched here as a 
workarround
**                del self._vm_last_timestamp[vmid]*

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/devel/attachments/20150428/10664770/attachment-0001.html>


More information about the Devel mailing list