[Tickets #10615] Locks on initial imp ajax requests

bugs at horde.org bugs at horde.org
Fri Oct 7 14:18:16 UTC 2011


Ticket URL: http://bugs.horde.org/ticket/10615
  Ticket             | 10615
  Created By         | goncalo.queiros at portugalmail.net
  Summary            | Locks on initial imp ajax requests
  Queue              | IMP
  Version            | Git master
  Type               | Enhancement
  State              | New
  Priority           | 1. Low
  Milestone          |
  Patch              |
  Owners             |

goncalo.queiros at portugalmail.net (2011-10-07 14:18) wrote:

When Imp starts, it makes two ajax calls "viewPort" and "listMailboxes".
While this requests are fast, the problem that im describing here is  
negligible, but when you introduce lag on the imap server, there's  
evidences that the listMailbox request will lock the session, thus  
dragging the viewPort request with it.

What i discovered is that viewPort has the lock on the session and  
releases it when there's a potential long running operation.  
Meanwhile, listMailboxes starts executing (because it grabbed the lock  
on the session), and immediately releases the lock to supposedly  
perform a long running operation...
The problem is that as far as i could test, the supposedly long run  
operation of listMailbox is not long, so it grabs the lock again  
(before viewPort does), and then it actually runs a potentially long  
operation (grabbing the list of all the mailboxes from imap, since  
this is not cachable).. Meanwhile viewport ends processing and it has  
to wait for the session to be unlocked before it can continue..

The problem is very noticeable, when you have  lag to the imap server  
(viewPort will generally retrieve its data from cache, so the lag is  
not important to it) while listMailboxes doesn't cache its result, so  
every folder will actually take some time to fetch.

 From what i've seen if you completely remove the lock releases from  
both requests, than viewPort will render much faster, and the user  
will only notice the loading on the folders sidebar.

Bug #7422 is the one responsible for introducing the lock releasing,  
but i think that back then, listMailbox supposedly long run operation  
was actually between the unlock/lock, and now it isn't.

More information about the bugs mailing list