Queries crash on expired connection in pool.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oursql |
Fix Committed
|
Undecided
|
Stephen Thorne |
Bug Description
I have a low traffic website that I maintain for my Universities ACM student chapter. It wasn't visited in a while since it was the summer. When I visited the site it had an error. However, when I refreshed it worked fine. This has happened before. Upon investigating the stack trace, it appears to be OurSQL trying to use a dead connection to the MySQL database. This might only be a problem for a low traffic site, but I thought I should report it any way. If you need any more information I would be happy to oblige.
- Ubuntu 10.10
- mysqld Ver 5.1.49-1ubuntu8.1 for debian-linux-gnu on x86_64 ((Ubuntu))
- mysql Ver 14.14 Distrib 5.1.49, for debian-linux-gnu (x86_64) using readline 6.1
- oursql.__version__ => '0.9.2'
crashing query:
(SQL Alchemy)
Session.
related model:
CREATE TABLE IF NOT EXISTS `session` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`key` varchar(64) COLLATE utf8_bin DEFAULT NULL,
`sig` tinyblob,
`sigkey` tinyblob,
`micro` tinyblob,
`csrf` tinyblob,
`user_id` int(11) DEFAULT NULL,
`last_update` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `ix_session_key` (`key`),
KEY `user_id` (`user_id`),
KEY `ix_session_
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=3179 ;
--
-- Dumping data for table `session`
--
## Note I slightly sanitized these rows to remove the sensitive private session information.
INSERT INTO `session` (`id`, `key`, `sig`, `sigkey`, `micro`, `csrf`, `user_id`, `last_update`) VALUES
(3177, '36e7afddea1ee9
(3178, '502874eee83fc7
traceback:
[20110831-09:24AM] [forhireapp] [ERROR] Exception on / [GET]
Traceback (most recent call last):
File "/home/
rv = self.dispatch_
File "/home/
return self.view_
File "./lib/
session = self.getsession()
File "./lib/
self.
File "./lib/
).delete(False)
File "/usr/local/
result = session.
File "/usr/local/
return self._connectio
File "/usr/local/
return self.transactio
File "/usr/local/
transaction = conn.begin()
File "/usr/local/
self.
File "/usr/local/
self.
File "/usr/local/
self.
File "/usr/local/
self.
File "/usr/local/
connection.
File "cursor.pyx", line 107, in oursql.
File "cursor.pyx", line 70, in oursql.
File "query.pyx", line 137, in oursql.
File "query.pyx", line 154, in oursql.
File "connection.pyx", line 180, in oursql.
OperationalError: (OperationalError) (2006, 'MySQL server has gone away', None) None None
Changed in oursql: | |
milestone: | none → 0.9.3 |
I've just made a commit to a branch here: lp:~jerub/oursql/reconnect that will allow you to connect with Connection(..., autoreconnect= True). Please test this branch and see if it solves your problem.
If it does, I will release 0.9.3 with this option available.