6.0.0-alpha12
6/7/25

[#8805] expanded_folders preference makes user unable to login
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

History
02/05/2010 10:33:20 PM Jan Schneider Milestone ⇒ 4.3.7
 
02/05/2010 09:31:50 PM Michael Slusarz Comment #9
Assigned to Michael Slusarz
State ⇒ Resolved
Reply to this comment
Good catch.  The proper/easiest fix is to check if the expanded 
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.
02/05/2010 09:27:03 PM CVS Commit Comment #8 Reply to this comment
12/29/2009 10:44:33 AM patrick (dot) guiran (at) linagora (dot) com Comment #6 Reply to this comment
How to reproduce :
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
12/29/2009 08:25:40 AM Jan Schneider Comment #5
New Attachment: export_sql_prefs[1].sql Download
Reply to this comment
This is the obfuscated version of the sql dump.
12/29/2009 08:24:45 AM Jan Schneider Deleted Original Message
 
12/29/2009 02:53:21 AM patrick (dot) guiran (at) linagora (dot) com Comment #4
New Attachment: login_with_patch.log Download
Reply to this comment
horde log ouput with $conf['log']['priority'] = PEAR_LOG_NOTICE; in 
config/conf.php

this log is made after applying the patch.
loggin time = 17 sec
12/29/2009 02:51:02 AM patrick (dot) guiran (at) linagora (dot) com Comment #3
New Attachment: login_without_patch.log Download
Reply to this comment
horde log ouput with $conf['log']['priority'] = PEAR_LOG_NOTICE; in 
config/conf.php

this log is made before applying the patch.
loggin time = 8min 45sec
12/29/2009 02:44:27 AM patrick (dot) guiran (at) linagora (dot) com Comment #2
New Attachment: export_sql_prefs.sql
Reply to this comment
export_sql_prefs.sql file, which was create through this query :

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'
12/29/2009 02:38:59 AM pguiran (at) linagora (dot) com Comment #1
Patch ⇒ Yes
State ⇒ Unconfirmed
New Attachment: horde-webmail-1.2.4-lng3_patch-expanded_folders_managment.patch Download
Milestone ⇒
Queue ⇒ IMP
Summary ⇒ expanded_folders preference makes user unable to login
Type ⇒ Bug
Priority ⇒ 2. Medium
Reply to this comment
Hi,

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 :(

Saved Queries