Fedora Gooey Karma now has its own repository! It was developed by examon (Tomas Meszaros) who wrote some basic functionality before. I’ve forked his repository and created a new one which will be the main for Google Summer of Code.
Problem with threads
Tomas did a lot of great work but the code needed some tweaks. The main problem I’ve hit was with threads in Python. BodhiClient query started from thread got stuck in deadlock. It’s important to have internet queries in different thread than main GUI to don’t get it freeze for user.
So I filled a bug 972429 against fedora-python (it contains BodhiClient class) because I thought it’s problem with that. After IRC discussion with Toshio Kuratomi we figured out that problem is in implementation of python (or QT) threads. Thread cannot be spawned from imported library as it’s mentioned on the very bottom of official docs page.
Firstly, other than in the main module, an import should not have the side effect of spawning a new thread and then waiting for that thread in any way. Failing to abide by this restriction can lead to a deadlock if the spawned thread directly or indirectly attempts to import a module.
This problem was pretty serious because Tomas’s code has pretty much everything imported from one main file. I had to rewrite it to some “less abstract” code. I’ve split classes to separated files. Now we have two main “workers”. 🙂 One is for packages which get info mainly from RPM database or YUM. Second one is communicating with Bodhi servers. Application spawns 15 threads of Bodhi workers now and I hope it will be good enough to have relevant results from servers in quite a short time.
You can see these changes in this and this commit.
What to do next
Now I’m going to edit Makefile to have it properly “installable” on system because it’s runnable from src/fedora-gooey-karma which can be a little confusing for random strangers now. 🙂
Pingback: Blog › Branislav Blaskovic: First time with Fedora Gooey Karma