Summary | Issue viewing sessions when using MySQL/PDO Driver |
Queue | Horde Base |
Queue Version | 4.0.13 |
Type | Bug |
State | Resolved |
Priority | 1. Low |
Owners | |
Requester | it (at) wenn (dot) com |
Created | 02/10/2012 (4907 days ago) |
Due | |
Updated | 02/20/2012 (4897 days ago) |
Assigned | |
Resolved | 02/10/2012 (4907 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
SessionHandler/Storage/Stack.php
The read method in that file that i can get a clear time reading that
shows it locking up.
Ive worked out that there are two storage objects, memcached & sql.
The time seems to be sticking on the Memcached driver.
SessionHandler/Storage/Memcache.php # line 91 - $this->_memcache->lock($id);
SessionHandler/Storage/Sql.php inside the read() method? Is it
transactionStarted(), beginDbTransaction() or selectValue()?
commit 788a5259f75d697d4bab5cd3c69f7660176a9316
Author: Jan Schneider <jan@horde.org>
Date: Fri Feb 10 18:51:27 2012 +0100
[jan] Don't start transaction more than once in SQL driver (
Bug #10978)..../lib/Horde/SessionHandler/Storage/Sql.php | 4 +++-
framework/SessionHandler/package.xml | 4 ++--
2 files changed, 5 insertions(+), 3 deletions(-)
http://git.horde.org/horde-git/-/commit/788a5259f75d697d4bab5cd3c69f7660176a9316
my patch it takes under 1 second to open up.
the additional time.
Horde/SessionHandler.php:177
It will hang on this call though to the DB read call but only if
userid is equal to the currently logged on userid. This was confimed
by putting a continue on a loop if id matched session_id;
So maybe it seems that you are still holding a row readlock open on
the session table of the user.
my patch it takes under 1 second to open up.
the additional time.
not fix the problem very well.
While your patch does stop the error from being created the page load
time is very very slow.
Without my patch the sessions page takes 9 seconds to open up, with my
patch it takes under 1 second to open up.
commit 788a5259f75d697d4bab5cd3c69f7660176a9316
Author: Jan Schneider <jan@horde.org>
Date: Fri Feb 10 18:51:27 2012 +0100
[jan] Don't start transaction more than once in SQL driver (
Bug #10978)..../lib/Horde/SessionHandler/Storage/Sql.php | 4 +++-
framework/SessionHandler/package.xml | 4 ++--
2 files changed, 5 insertions(+), 3 deletions(-)
http://git.horde.org/horde-git/-/commit/788a5259f75d697d4bab5cd3c69f7660176a9316
Patch ⇒ No
Priority ⇒ 1. Low
transaction just after you retrieve all the the SessionIDs,
afterwards you then have to do lots more reads.
is commited when writing the session information at the request's end.
Priority ⇒ 3. High
Type ⇒ Bug
Summary ⇒ Issue viewing sessions when using MySQL/PDO Driver
Queue ⇒ Horde Base
Milestone ⇒
Patch ⇒ Yes
New Attachment: horde.patch
State ⇒ Unconfirmed
--horde.log--
2012-02-10T12:58:08+00:00 EMERG: HORDE [horde] There is already an
active transaction [pid 28447 on line 644 of
"/home/httpd/live/webmail.wenn.com/htdocs/pear/php/Horde/Db/Adapter/Base.php"]
--weboutput--
A fatal error has occurred
There is already an active transaction
1. Horde_SessionHandler->getSessionsInfo()
/home/httpd/live/webmail/htdocs/admin/sessions.php:29
2. Horde_SessionHandler->read()
/home/httpd/live/webmail/htdocs/pear/php/Horde/SessionHandler.php:275
3. Horde_SessionHandler_Storage_Stack->read()
/home/httpd/live/webmail/htdocs/pear/php/Horde/SessionHandler.php:177
4. Horde_SessionHandler_Storage_Sql->read()
/home/httpd/live/webmail/htdocs/pear/php/Horde/SessionHandler/Storage/Stack.php:88
5. Horde_Db_Adapter_Base->beginDbTransaction()
/home/httpd/live/webmail/htdocs/pear/php/Horde/SessionHandler/Storage/Sql.php:91
6. PDO->beginTransaction()
/home/httpd/live/webmail.wenn.com/htdocs/pear/php/Horde/Db/Adapter/Base.php:644
This error does not happen straight away after you login, it happens
after you have gone though a few pages.
The issue does not seem to happen if i use the MySQLi driver instead
of the PDO.
Things to note, we are running horde sessions in MySQL due to having a
HAproxy LB setup.
Ive attached a patch file to fix. Seems that you are not closing the
transaction just after you retrieve all the the SessionIDs, afterwards
you then have to do lots more reads.