#21597: (2006, 'MySQL server has gone away') in django1.6 when wait_timeout
passed
-------------------------------------+-------------------------------------
Reporter: ekeydar@… | Owner: aaugustin
Type: Bug | Status: closed
Component: Database layer | Version: 1.6
(models, ORM) | Resolution: wontfix
Severity: Release blocker | Triage Stage: Accepted
Keywords: mysql | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 1
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Comment (by germanoguerrini):
I know I'll be hated for this, but it actually happens even for regular
web queries. We installed 1.6.5 on one of our production servers yesterday
and we received a hundred or so tracebacks from some of our views. I can't
do the math, but it's probably less then 1%. Still, with 1.5 we had no
issues.
To give you an idea, the problem arises both from select and insert
statements. They could take maybe fractions of second. I triple checked
MySql variables and `wait_timeout` is 28800, while `connection_timeout` is
10 seconds (which, by the way, should raise a `Lost connection to MySQL
server`).
I tried switching from `CONN_MAX_AGE = 0` to `CONN_MAX_AGE = 2` and
nothing changed, so maybe it's not related with the new persistent
connection mechanism.
The traceback is slightly different from the one in comment 19:
{{{
Traceback (most recent call last):
[...]
File "/home/django/VIRTUALENVS/multi/lib/python2.7/site-
packages/django/db/models/query.py", line 96, in __iter__
self._fetch_all()
File "/home/django/VIRTUALENVS/multi/lib/python2.7/site-
packages/django/db/models/query.py", line 857, in _fetch_all
self._result_cache = list(self.iterator())
File "/home/django/VIRTUALENVS/multi/lib/python2.7/site-
packages/django/db/models/query.py", line 220, in iterator
for row in compiler.results_iter():
File "/home/django/VIRTUALENVS/multi/lib/python2.7/site-
packages/django/db/models/sql/compiler.py", line 713, in results_iter
for rows in self.execute_sql(MULTI):
File "/home/django/VIRTUALENVS/multi/lib/python2.7/site-
packages/django/db/models/sql/compiler.py", line 786, in execute_sql
cursor.execute(sql, params)
File "/home/django/VIRTUALENVS/multi/lib/python2.7/site-
packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "/home/django/VIRTUALENVS/multi/lib/python2.7/site-
packages/django/db/utils.py", line 99, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/django/VIRTUALENVS/multi/lib/python2.7/site-
packages/django/db/backends/util.py", line 53, in execute
return self.cursor.execute(sql, params)
File "/home/django/VIRTUALENVS/multi/lib/python2.7/site-
packages/django/db/backends/mysql/base.py", line 124, in execute
return self.cursor.execute(query, args)
File "/home/django/VIRTUALENVS/multi/lib/python2.7/site-
packages/MySQLdb/cursors.py", line 205, in execute
self.errorhandler(self, exc, value)
File "/home/django/VIRTUALENVS/multi/lib/python2.7/site-
packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
OperationalError: (2006, 'MySQL server has gone away')
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/21597#comment:38>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/075.79dfbec9b1cdb3ed0b23bfcd0172ed12%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.