Process "#2006 MySQL server has gone away" database server error

8 views
Skip to first unread message

Alexander Obuhovich

unread,
Feb 14, 2011, 4:46:30 AM2/14/11
to In-Portal Bugs
When database server process dies and then gets restarted again, then any active php script that was doing database query at that time will get "#2006 MySQL server has gone away" error.

We should do automatic disconnect and reconnect in case if that happens.

Also maybe checking mysql error description page could be useful, since there maybe other cases where this could be a problem. 

--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com

Dmitry A.

unread,
Feb 14, 2011, 12:17:54 PM2/14/11
to in-port...@googlegroups.com
Hi Alex,


Yes, in a perfect world we want to handle all MySQL errors gracefully.

The question is can we do it now with current MySQL integration in 5.1.x or we need to re-factor it and make things more transparent 


Cheers!

DA

Alexander Obuhovich

unread,
Feb 14, 2011, 12:23:20 PM2/14/11
to in-port...@googlegroups.com
We can do it in 5.1.x branch.

I'll explain why this is important. When there is a high traffic on the site, then server admin may even need to restart MySQL server to solve the problem. In case, when ongoing agent is being executed at that time, then he doesn't react properly to that error and tries to run next sql with same error returned. This way, when error logging is enabled, then you'll get a lot (depending on sql count executed there) of errors there.

I've personally witnessed 2 millions of errors (agent was doing 1 query every second) in 2 days.


--
You received this message because you are subscribed to the Google Groups "In-Portal Bugs Team" group.
To post to this group, send email to in-port...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-bug...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/in-portal-bugs?hl=en.

Dmitry A.

unread,
Feb 14, 2011, 12:30:06 PM2/14/11
to in-port...@googlegroups.com
Thanks for explanation - I am convinced.

Please create a task describing this and perhaps other common MySQl cases we should address.

I suppose it's a bug and not a feature?


DA

Alexander Obuhovich

unread,
Feb 14, 2011, 12:59:25 PM2/14/11
to in-port...@googlegroups.com
It's a bug.




DA

--
You received this message because you are subscribed to the Google Groups "In-Portal Bugs Team" group.
To post to this group, send email to in-port...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-bug...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/in-portal-bugs?hl=en.

Alexander Obuhovich

unread,
Feb 18, 2011, 3:22:26 AM2/18/11
to in-port...@googlegroups.com
Here is the patch.

Ready for testing.
processing_of_mysql_has_gone_away_error.patch
Reply all
Reply to author
Forward
0 new messages