[geeklog-hg] geeklog: Fixed table deadlock issues with sessions table

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun Nov 3 16:48:11 EST 2013


changeset 9329:d4fd6468a42b
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/d4fd6468a42b
user: Tom <websitemaster at cogeco.net>
date: Sun Nov 03 16:47:33 2013 -0500
description:
Fixed table deadlock issues with sessions table

diffstat:

 public_html/lib-common.php |  2 ++
 system/lib-sessions.php    |  2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diffs (27 lines):

diff -r 349676bb1bff -r d4fd6468a42b public_html/lib-common.php
--- a/public_html/lib-common.php	Sat Nov 02 14:39:52 2013 -0400
+++ b/public_html/lib-common.php	Sun Nov 03 16:47:33 2013 -0500
@@ -485,7 +485,9 @@
 );
 
 // Clear out any expired sessions
+DB_lockTable($_TABLES['sessions']);
 DB_query( "UPDATE {$_TABLES['sessions']} SET whos_online = 0 WHERE start_time < " . ( time() - $_CONF['whosonline_threshold'] ));
+DB_unlockTable($_TABLES['sessions']);
 
 /**
 * Global array of groups current user belongs to
diff -r 349676bb1bff -r d4fd6468a42b system/lib-sessions.php
--- a/system/lib-sessions.php	Sat Nov 02 14:39:52 2013 -0400
+++ b/system/lib-sessions.php	Sun Nov 03 16:47:33 2013 -0500
@@ -332,8 +332,10 @@
                                             array(1, $remote_ip));
         }
     } else {
+        DB_lockTable($_TABLES['sessions']);
         $deleteSQL = "DELETE FROM {$_TABLES['sessions']} WHERE (start_time < $expirytime)";
         $delresult = DB_query($deleteSQL);
+        DB_unlockTable($_TABLES['sessions']);
 
         if ($_SESS_VERBOSE) {
             COM_errorLog("Attempted to delete rows from session table with following SQL\n$deleteSQL\n",1);



More information about the geeklog-cvs mailing list