6.0.0-beta1
9/1/25

[#10615] Locks on initial imp ajax requests
Summary Locks on initial imp ajax requests
Queue IMP
Queue Version Git master
Type Enhancement
State Resolved
Priority 1. Low
Owners slusarz (at) horde (dot) org
Requester goncalo.queiros (at) portugalmail (dot) net
Created 10/07/2011 (5078 days ago)
Due
Updated 10/10/2011 (5075 days ago)
Assigned
Resolved 10/10/2011 (5075 days ago)
Milestone
Patch No

History
10/10/2011 04:11:58 AM Michael Slusarz Assigned to Michael Slusarz
State ⇒ Resolved
 
10/10/2011 04:11:34 AM Git Commit Comment #3 Reply to this comment
Changes have been made in Git for this ticket:

Ticket #10615: folder tree should be initialized when session is closed

  1 files changed, 1 insertions(+), 2 deletions(-)
http://git.horde.org/horde-git/-/commit/356a745f048df0d62b5734e7f3bf11eb78f26e07
10/10/2011 04:11:14 AM Michael Slusarz Comment #2 Reply to this comment

[Show Quoted Text - 10 lines]
This is incorrect.  listMailboxes() does all IMAP calls related to 
querying the mailbox tree when the session lock has been released.  By 
the time the session has been re-locked, there should be very little 
(if anything) left to be done on the server (either PHP or IMAP).

That being said... looks like there is a mistake in listMailboxes().   
We are creating the IMP_Imap_Tree object before locking the session.   
If this is the first time we have created the object, init() is 
automatically called.  So we are doing the mailbox listing before we 
even close the session.  This needs to be (and should now be) fixed.
.
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.
This is incorrect.  At least one of these processes is blocking the 
other - so there's no way it can be faster.
10/07/2011 02:18:16 PM goncalo (dot) queiros (at) portugalmail (dot) net Comment #1
Priority ⇒ 1. Low
Patch ⇒ No
Milestone ⇒
Queue ⇒ IMP
Summary ⇒ Locks on initial imp ajax requests
Type ⇒ Enhancement
State ⇒ New
Reply to this comment
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.

Saved Queries