From 32841599b5a8a0b003dca545e623cb3a53cc2cbb Mon Sep 17 00:00:00 2001 From: Soren Hansen Date: Fri, 9 Dec 2011 14:43:38 +0100 Subject: [PATCH] Log it when we get a lock Currently, we log it when we attempt to acquire a log, but we don't mention it when we succesfully do acquire it. This makes people think it's stuck. This patch logs the succesful acquiry of locks. Change-Id: I3b49ff331641ceafa46c93d8f5233c85fe45e5e2 --- nova/utils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nova/utils.py b/nova/utils.py index 4fa3860d8..e79d57622 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -719,6 +719,9 @@ def synchronized(name, external=False): '"%(method)s"...' % {'lock': name, 'method': f.__name__})) with sem: + LOG.debug(_('Got semaphore "%(lock)s" for method ' + '"%(method)s"...' % {'lock': name, + 'method': f.__name__})) if external: LOG.debug(_('Attempting to grab file lock "%(lock)s" for ' 'method "%(method)s"...' % @@ -730,6 +733,10 @@ def synchronized(name, external=False): lock = _NoopContextManager() with lock: + if external: + LOG.debug(_('Got file lock "%(lock)s" for ' + 'method "%(method)s"...' % + {'lock': name, 'method': f.__name__})) retval = f(*args, **kwargs) # If no-one else is waiting for it, delete it.