[packagekit] Python fork() question

Richard Hughes hughsient at gmail.com
Wed Mar 5 11:14:57 PST 2008


On Wed, 2008-03-05 at 16:25 +0100, Sebastian Heinlein wrote:
> Am Dienstag, den 04.03.2008, 12:54 +0000 schrieb Richard Hughes:
> > Sure. I'm thinking threading might be a better plan than forking right
> > now.
> 
> I added threading and cancel support to the apt2 backend in the
> forked-dbus-backend branch. The yum2 forking stlye can still be used 
> by applying the new forked decorator.

Looks great. One request: Could you please also convert the
backend/test/helpers/PackageKitDbusTest.py to use threading please? I
want to run it with my super-l33t self check code and see it myself.

Also, about your code:
#FIXME: Would be nice to have some feedback here:
You can set the status to STATUS_CANCELLING if that helps.

> Furthermore I tried to adapt the yum2 backend to the new API, since I am
> familiar with the feeling of getting broken :)

Well, if the threading stuff works well maybe we can just dump fork
completely? Or do I misunderstand things?

> What are the correct exit states for the cancel method? Why do I get a
> time out error for my Cancel call?

Well, Cancel() should terminate the thread that's doing the action
(yum/apt/whatever) and then probably return normally. If we have to just
self.exit out of the python file, then we can just call Cancel() with
_no_reply as we know it isn't going to fail.

> Would be nice to wait a little and 
> see if the canceling was done successfully.

Do you mean set some sort of status?

Richard.






More information about the PackageKit mailing list