On 18 févr. 2013, at 23:30, Karen Tracey <kmtra...@gmail.com> wrote:
> Will persistent connections be able to ensure that "bad connections" (e.g. > those in state "current transaction is aborted, commands ignored until end of > transaction block") don't leak from one request to another? I'm calling connection.abort() at the end of each request to avoid this. If there are bugs in connection.abort(), I'll try to fix them. > MySQL, at least, will close a connection from the server side if it is idle > for too long (no idea if that is configurable, I've never had reason to > investigate...have just noticed the behavior). In the pull request it looks > like we only check for the need to close at the end of a request cycle? For a > very low activity site it seems those two behaviors could interact badly, > with the request cycle finishing code deciding to keep the connection around > since it's not too old....long delay until next request while MySQL server > closes what it sees as an idle connection...next request tries to use a > connection that the server has closed? Indeed, that could be a problem. To mitigate it, I could: - check the connection's max age before each request, and reopen it if it's outdated (in addition to the current check after each request, required to emulate the current behavior); - implement a "ping" before each request — but I'd really prefer to avoid this overhead; - disable persistent connections by default :( -- Aymeric. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at http://groups.google.com/group/django-developers?hl=en. For more options, visit https://groups.google.com/groups/opt_out.