durusmail: quixote-users: MySQL server has gone away
MySQL server has gone away
2006-01-17
2006-01-18
2006-01-18
2006-01-19
2006-02-01
MySQL server has gone away
Bo Yang
2006-02-01
I had exactly the same problem after upgrading to mysql 5. After 2
weeks of wild goose chasing, I think I found the problem.

from http://dev.mysql.com/doc/refman/5.0/en/upgrading-from-4-1.html :

    "... The reconnect flag in the MYSQL structure is set to 0 by
mysql_real_connect().
     Only those client programs which did not explicitly set this
flag to 0 or 1 after
     mysql_real_connect() experience a change. Having automatic
reconnection
     enabled by default was considered too dangerous (due to the fact
that table
     locks, temporary tables, user variables, and session variables
are lost after
     reconnection). "

this change happened in 5.0.3. after 5.0.13 there's a new
MYSQL_OPT_RECONNECT parameter for myql_options() of mysql C API, but
I can't figure out how to set it in MysqlDB.

my guess is one or few of the quixote processes idled for too long,
mysql connection timed out, there's no auto-reconnect, and you get
the "'MySQL server has gone away" messages.

this is what I do now: set wait_timeout in my.cnf to 12 hours, and
use cron to restart my quixote processes every 12 hours. far from
elegant, but better than hacking MysqlDB myself.

- bo

http://blog.douban.net

On Jan 18, 2006, at 5:39 AM, Mike Orr wrote:

> I moved my Quixote applications to a new Linux server and upgraded to
> MySQL 5, and suddenly now things hang up sometimes with 'MySQL server
> has gone away' exceptions.  The MySQL manual suggests several possible
> reasons (timeout on client thread, large query size/result size, MySQL
> server restarting itself), but I was wondering whether anyone else is
> getting this in a Quixote context, especially with session2.  Using
> Quixote 2.4, scgi 1.9, session2 0.6, Apache 2.0.54, MySQL 5.0.16,
> Linux Gentoo 2005.1.
>
> The MySQL server is responding fine; I just have to restart the
> Quixote application.  But MySQL shows three idle connections from
> Quixote sleeping.  Is something in Quixote or session2 using
> persistent connections?
>
> --
> Mike Orr 
> (mso@oz.net address is semi-reliable)
> _______________________________________________
> Quixote-users mailing list
> Quixote-users@mems-exchange.org
> http://mail.mems-exchange.org/mailman/listinfo/quixote-users

reply