[Kde-pim] Proposal for a solution for bug 77862

Thomas McGuire mcguire at kde.org
Thu May 20 18:27:33 BST 2010


Hi,

On Tuesday 18 May 2010 19:28:18 Guy Maurel wrote:
> > Please try out if setting a timeout works. You can either use something
> > else than responseTimeout() whan calling waitForResponse(), or use     
> > setMetaData to set a lower response timeout (with the "ResponseTimeout"
> > key). The metadata is internally used by SlaveBase::responseTimeout(). 
>                                                                          
> it doesn't work on this way because the                                  
>    void SlaveBase::setMetaData(const QString &key, const QString &value) 
> use the                                                                  
>     mOutgoingMetaData.insert(key, value);                                
>                                                                          
> and the                                                                  
>    QString SlaveBase::metaData(const QString &key) const                 
> use another variable                                                     
>    if (mIncomingMetaData.contains(key))                                  
>                                                                          
> or there is some method to copy the data??                               

Oh, I see, there are two different kinds of metadata, didn't know that.
I think the incoming metadata, which includes the response timeout, can only 
be set from the application.                                                 
Maybe try setting this in ImapAccountBase::slaveConfig()? This method creates 
the metadata that is sent to the slave, and I think it will be available there 
as mIncomingMetaData.                                                          

> > So setting a lower response timeout, maybe in combination with a
> > cMD_DISCONNECT, for example by using cancelMailCheck() in KMail.
> > I have the feeling that a sensible timeout, like 30 seconds, instead of
> > 600                                                                    
>                                                                          
> I tried it direct, as I changed the value of "ResponseTimeout" in the    
> config-file: .kde/share/config/kioslaverc                                
> to a very low value (10 seconds).                                        
>                                                                          
> After waiting about 5-6 minutes I got what I needed. The kio_imap4 goes  
> away. I think, the time is too long. There must be some other "timeout". I
> will look for them.                                                       

There are two different kind of timeouts: The first one is the timeout for 
waiting when reading or waiting to read from a socket. That is what I talked 
about earlier.                                                               
The second timeout is the timeout until a KIO slave process gets killed. When 
KIO slave processes are not used anymore, they are kept around for some time  
so that they can be re-used by another application or by the same application. 
This is most noticeable for the HTTP KIO slave, creating and destroying a KIO  
process for each HTTP request would be costly, therefore the timeout of a few
minutes to re-use the slaves.

I think the re-using the same slave after suspend/wakeup is no problem, and 
therefore the slave reuse timeout can stay high.
The only thing we need to make sure is that the connection gets disconnected 
and reconnects again on wakeup. As far as I can see in the code, the slave 
will automatically close the connection if the response timeout is triggered, 
right?

>
> You had written, my solution was not portable. It was right.
> Now I propose a portable solution, tested by some friends:
> in the file kmkernel.cpp:

I'd really prefer that only as the last resort, I have the feeling that we're 
very close to a proper solution with the above.

Regards,
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20100520/08827034/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list