Summary | expanded_folders preference makes user unable to login |
Queue | IMP |
Queue Version | 4.3.5 |
Type | Bug |
State | Resolved |
Priority | 2. Medium |
Owners | slusarz (at) horde (dot) org |
Requester | pguiran (at) linagora (dot) com |
Created | 12/29/2009 (5639 days ago) |
Due | |
Updated | 02/10/2010 (5596 days ago) |
Assigned | |
Resolved | 02/05/2010 (5601 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | 4.3.7 |
Patch | Yes |
Ticket #8805: Optimize folder tree initializationhttp://git.horde.org/diff.php/imp/docs/CHANGES?rt=horde-git&r1=7eba9311ccd488faabe102efee17cca2be7f4f72&r2=a3f0c954834ed50d3cbe84863651ab82e3c0c529
http://git.horde.org/diff.php/imp/lib/Imap/Tree.php?rt=horde-git&r1=0c1052a540e265a727f23198513edba7edaf9c50&r2=a3f0c954834ed50d3cbe84863651ab82e3c0c529
Assigned to Michael Slusarz
State ⇒ Resolved
mailbox provided to _modifyExpandedList() will change the current
expanded list entry, and only set the value if this value changes.
Performing garbage collection on this preference value is not a good
idea in IMP 4.x. This is better done in IMP 5 where we can set up a
system task to occasionally do this. However, the expanded list
preference may be going away in the near future since it has a major
limitation: it doesn't work across various mail servers. So I am not
in any rush to create a garbage collection script in IMP 5 either.
Bug: 8805Merge from horde-git: a3f0c954834ed50d3cbe84863651ab82e3c0c529
http://cvs.horde.org/diff.php/imp/docs/CHANGES?rt=horde&r1=1.699.2.419&r2=1.699.2.420&ty=u
http://cvs.horde.org/diff.php/imp/lib/IMAP/Tree.php?rt=horde&r1=1.25.2.70&r2=1.25.2.71&ty=u
Ticket #8805: Optimize folder tree initializationhttp://git.horde.org/diff.php/imp/docs/CHANGES?rt=horde-git&r1=7eba9311ccd488faabe102efee17cca2be7f4f72&r2=a3f0c954834ed50d3cbe84863651ab82e3c0c529
http://git.horde.org/diff.php/imp/lib/Imap/Tree.php?rt=horde-git&r1=0c1052a540e265a727f23198513edba7edaf9c50&r2=a3f0c954834ed50d3cbe84863651ab82e3c0c529
1/ logout from horde
2/ sed -ie 's/^pguiran/you_login/g' export_sql_prefs.sql
3/ load export_sql_prefs.sql with "load file" mysql command
4/ login to horde
New Attachment: export_sql_prefs[1].sql
New Attachment: login_with_patch.log
config/conf.php
this log is made after applying the patch.
loggin time = 17 sec
New Attachment: login_without_patch.log
config/conf.php
this log is made before applying the patch.
loggin time = 8min 45sec
New Attachment: export_sql_prefs.sql
SELECT pref_scope, pref_name, pref_value FROM horde_prefs WHERE
pref_uid = 'pguiran' AND ( pref_scope = 'imp' OR pref_scope = 'horde'
) INTO OUTFILE 'export_sql_prefs.sql'
Patch ⇒ Yes
State ⇒ Unconfirmed
New Attachment: horde-webmail-1.2.4-lng3_patch-expanded_folders_managment.patch
Milestone ⇒
Queue ⇒ IMP
Summary ⇒ expanded_folders preference makes user unable to login
Type ⇒ Bug
Priority ⇒ 2. Medium
One of my user have problems to login into horde and it seems that the
problem is from the 'expanded_folders' preference. In fact, its
'expended_folder' preference in database may grown up with horde's
upgrades, or with an unknown problem. Its 'expanded_folder' preference
contain more than 1000 elements (old, unused, etc... elements) !
When the user login into horde, 'expanded_folders' is loaded from
database, IMAP connects to the imap server, receives list of mailbox,
makes modifications into 'expanded_folders' and store it into database
and session. All those operations take lot of time, and the webserver
connection is timeout or the web client close the connection due to
timeout. So the user can't login.
The problem is that at each modification of 'expanded_folder',
serialize + Prefs_sql::setValue() are called, which take lots of time.
In fact, the call chain is : serialize -> Prefs_sql::setValue() ->
Prefs::_setValue() -> Prefs_sql::convertToDriver() ->
String::convertCharset() on a 150KB string :-(
I attach to this ticket a patch :
* modify IMAP_Tree::_modifyExpandedList() -> track modification of
$this->_expanded instead of the modification of the serialization of
$this->_expanded
** add: if the value modified was in $this->_expanded, the
Prefs_sql::isDurty( 'expanded_folders', true ) is called
** del: call of Prefs_sql::setValue() and of serialize()
* modifify IMAP_Tree::_store()
** add: track modification of $this->_expanded and save it if necessary
** add: call of $this->_cleanExpandedList()
* IMAP_Tree::_cleanExpandedList()
** only work when $this->_fulllist is not null, ie when the class
has had a connection with the imap server
** try to clean $this->_expanded by removing useless entries.
I attach more information about tests files etc... in reply to this ticket.
Patrick,
ps : Sorry for my bad english :(