Hi,
With SQLObject 0.8.0b1 my program hangs indefinitely with 100% CPU
usage if the MySQL server has been gone (Error code 2006) while still
holding the connection in SQLObject and performing a request
afterwards.
The relevant code is in mysqlconnection.py:
def _executeRetry(self, conn, cursor, query):
while 1:
try:
if self.need_unicode:
# For MysqlDB 1.2.1 and later, we go
# encoding->unicode->charset (in the mysql db)
myquery = unicode(query, self.encoding)
return cursor.execute(myquery)
else:
return cursor.execute(query)
except MySQLdb.OperationalError, e:
if e.args[0] in (2006, 20013): # SERVER_GONE or
SERVER_LOST error
if self.debug:
self.printDebug(conn, str(e), 'ERROR')
else:
raise OperationalError(ErrorMessage(e))
* First, 20013 is a typo must be changed back to 2013. See
http://dev.mysql.com/doc/refman/5.0/en/error-messages-client.html
* Second, the newly introduced 2006 triggers the infinite loop in my
case. I think there is a raise missing. The bug is already there in
SQLObject 0.7.x but the error code 2006 wasn't checked there, so the
buggy section which misses a raise was not entered.
Kind regards,
Markus
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss