Why does my MySQL 5.0.X connection time out when using SER 0.9.X?

Keywords: mysql

When MySQL changed over from 4.X to 5.0.X, they made a modification to the the way the sockets in MySQL are kept open. By default, starting about MySQL 5.0.3, the sockets automatically close after a period of time. This causes problems for SERi because it keeps its connection to a single MySQL socket for a long time. When the socket times out, SER is no longer able to access MySQL.  In the MySQL code base, they added a patch as of 5.0.12 to allow you to specify that you want the socket to auto-reconnect. However, until MySQL 5.0.19, this patch did not work properly.

If you're running MySQL 5.0.18 or below, it is highly recommended you upgrade to 5.0.19 for use with SER.

Once you're running 5.0.19 or above, you will need to replace the $SER-SRC/modules/mysql/my_con.c file with a patched one (a patched file can be found at http://www.ideasip.com/support/utils/my_con.c ). Once you've replaced the my_con.c file, you'll need to recompile the mysql module (from the $SER-SRC directory, type:  make modules=modules/mysql modules    ), and replace the old mysql module with the new, patched one (remember to shut down SER before replacing modules that are in use).

Once you've patched and replaced the mysql module with the one that allows reconnects, SER should no longer have a problem with connections disappearing.

Please remember, this is a patch for MySQL 5.0.19+ and SER 0.9.X ONLY. While the basics of the patch are, essentially, three extra lines of code and could easily be applied to the new SER 2.0 codebase, it's highly likely that this patch itself will not work directly in the SER 2.0 code. 

 

Quoting Jan: supported both in 2.0 and 2.1 SER now. (-jiri, 2007-10-30)

Home |  Recent changes |  Search |  Glossary |  Sitemap |  Login