On Wed, 2013-03-06 at 18:14 -0500, Chris Lumens wrote:
We've got a temporary locking issue somewhere that causes the UI
to become
unresponsive for a bit (see #886680, perhaps other bugs). Examining the code
indicates this isn't necessarily due to running things in the main loop
that shouldn't be. There's something waiting for the _yum_lock. This patch
adds logging to help debug.
---
pyanaconda/packaging/yumpayload.py | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index 9549420..fe132f7 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -94,9 +94,25 @@ from pykickstart.constants import KS_MISSING_IGNORE
default_repos = [productName.lower(), "rawhide"]
-from threading import RLock
-_yum_lock = RLock()
+import inspect
+import threading
+_private_yum_lock = threading.RLock()
+class YumLock(object):
+ def __enter__(self):
+ frame = inspect.stack()[2]
+ threadName = threading.currentThread().name
+
+ log.info("about to acquire _yum_lock for %s at %s:%s (%s)" %
(threadName, frame[1], frame[2], frame[3]))
+ _private_yum_lock.acquire()
+ log.info("have _yum_lock for %s" % threadName)
+ return _private_yum_lock
+
+ def __exit__(self, exc_type, exc_val, exc_tb):
+ _private_yum_lock.release()
+ log.info("gave up _yum_lock for %s" % threading.currentThread().name)
+
+_yum_lock = YumLock()
_yum_cache_dir = "/tmp/yum.cache"
class YumPayload(PackagePayload):
Looks good to me. I also noticed the hang and
tried to debug it a
little, but I gave up after a while cause it looked to me that it is
something yum-internal. I did some "time profiling" to find out which
place is waiting for something, but there was no result of it. The only
thing I found out was that the hang ends with some info about ignored
exception in yum printed to tty1. Maybe that's where the problem lies.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic