#21597: (2006, 'MySQL server has gone away') in django1.6 when wait_timeout 
passed
-------------------------------------+-------------------------------------
     Reporter:  ekeydar@…            |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  1.6
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:  Accepted
     Keywords:  mysql                |      Needs documentation:  0
    Has patch:  0                    |  Patch needs improvement:  0
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

Comment (by andreis):

 Hi,
 to me it seems to be a bug. Old django would close every connection right
 away, django 1.6 checks with CONN_MAX_AGE:
 1. It gets CONN_MAX_AGE from DATABASES, sets close_at:

 {{{
 max_age = self.settings_dict['CONN_MAX_AGE']
 self.close_at = None if max_age is None else time.time() + max_age
 }}}

 2. Actually the code above affects close_if_unusable_or_obsolete, which
 closes the connection if 'self.close_at is not None and time.time() >=
 self.close_at'
 3. close_if_unusable_or_obsolete itself is being called by
 close_old_connections, which in turn is a request handler for
 signals.request_started and signals.request_finished.

 We have a worker, which is effectively a django app but but it doesn't
 process any HTTP requests. In fact that makes all connections persistent
 because close_old_connections never gets called.

 Please advise.

 Thanks

-- 
Ticket URL: <https://code.djangoproject.com/ticket/21597#comment:12>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/075.67b7649e7bf3e036bf981c2cfb24a0a3%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to