Ticket #219 (assigned defect)

Opened 18 months ago

Last modified 18 months ago

Unreturned DB connections in session management

Reported by: winfried Owned by: winfried
Priority: P1 Milestone: HelpIM3 stable
Component: intranet Version: 3.0
Severity: critical Keywords:
Cc:

Description

The intranet opens db-connections, but doesn't return them. Later on, the sessions get flushed, resulting in:

(OperationalError) (2006, 'MySQL server has gone away') u'INSERT INTO `auth_Sess
ion` (`session_sessionId`, `session_requestId`, session_user_id, session_last_ur
l_requested, session_creation_timestamp, session_lastactive_timestamp) VALUES (%
s, %s, %s, %s, now(), now())' ['1ef7c180637919acf74b93b967a52aa8', None, None, N
one]
  File "/usr/local/lib/HelpIM3/HelpIM/appl/application.py", line 260, in __call_
_
    him_request = HIM_Request(site=site, environment=environ)

  File "/usr/local/lib/HelpIM3/HelpIM/appl/application.py", line 786, in __init_
_
    self.site.flush(self.site)

or:

(OperationalError) (2006, 'MySQL server has gone away') u"Update auth_Session set session_user_id = null where session_lastactive_timestamp < '2010-08-16 15:38:59.458458'" []
  File "/usr/local/lib/HelpIM3/HelpIM/appl/application.py", line 271, in __call__
    him_request = HIM_Request(site=site, environment=environ)

  File "/usr/local/lib/HelpIM3/HelpIM/appl/application.py", line 791, in __init__
    self.session = self.site.getSessionBySessionId(self.site, self.sessionId)

  File "/usr/local/lib/HelpIM3/HelpIM/auth/db/services.py", line 174, in getSessionBySessionId
    self.sessionCleanup(site)

  File "/usr/local/lib/HelpIM3/HelpIM/auth/db/services.py", line 209, in sessionCleanup
    self.expireSessions(site, expirationTime)

  File "/usr/local/lib/HelpIM3/HelpIM/auth/db/services.py", line 216, in expireSessions
    dbSession.execute("Update auth_Session set session_user_id = null where session_lastactive_timestamp < '%s'" % expiration_timestamp)

Change History

Changed 18 months ago by winfried

  • owner changed from winfried@… to winfried
  • status changed from new to assigned

Changed 18 months ago by winfried

Note: the engine is created with 'pool_recycle=3600', so when the connections are returned properly, the 'gone away' errors should not happen.

This error might be in the session management, because when new session-management related queries are executed, apparently the connection is reused, so probably the current activity is closed first.

Changed 18 months ago by winfried

  • version set to 3.0
Note: See TracTickets for help on using tickets.