Separating kwalletd from kded

Thiago Macieira thiago at kde.org
Fri Jun 20 12:01:26 BST 2008


On Friday 20 June 2008 12:48:14 Lubos Lunak wrote:
> On Thursday 19 of June 2008, Michael Leupold wrote:
> > Hi,
> >
> > in a short while I will do a commit separating the kwallet daemon from
> > kded by making it standalone. This was deemed neccessary as after the
> > migration to DBus kpasswdserver and kwalletd couldn't communicate any
> > longer because they both lived in kded
>
>  ??? Are there some more details on this? This looks like a bug in DBUS and
> I'd be surprised if we didn't do this in more modules (well, actually, I'm
> pretty sure we do).

It's not a bug. It happens because kwalletd is trying to do delayed replies 
(i.e., it will send the reply later, after a some event happened, from the 
event loop), but kpasswdserver requires the reply to be finished immediately.

This works fine if the two are in different processes because the caller would 
just block on the socket waiting for the reply to come.

But since they are both in the same process, this doesn't work. If the caller 
blocked, the callee would never have the chance to do its work. If we let the 
callee do its work, the caller can't be blocking.

The only solution is to go back to the event loop while waiting for the reply 
in the kpasswdserver's side, but that also means more calls may come in. 
kpasswdserver can't handle that.

The same could happen with sockets directly: caller blocks on 
waitForReadyRead(), but callee never gets its readyRead() signal because they 
are in the same process. D-Bus only makes it worse because the transport 
channel is the same, so a threaded approach wouldn't help.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080620/20ea5645/attachment.sig>


More information about the kde-core-devel mailing list