[Mod_log_sql] permanent reconnections

Edward Rudd urkle at outoforder.cc
Fri Feb 15 09:17:00 EST 2008


I will take a look at this and make sure that fixes it.

Thanks for finding this issue.

Also, what versions of apache and mysql are you using??

On Feb 15, 2008, at 8:59 AM, Robert Schulze wrote:

> Hi,
>
> I've now added some more debugging output to mod_log_sql.c and
> mod_log_sql_mysql.c. As you can see
>
> - log_sql_close_link() issues a message, when it is called, and  
> whether
> the db-link is up.
> - log_sql_mysql_close() issues a message, when it is called
>
> Here is a bit output from the httpd-error.log
>
> 8<--------------------------------------------------------------------
>
> [Fri Feb 15 14:37:27 2008] [error] log_sql_close_link called(), db
> connected: 1
> [Fri Feb 15 14:37:27 2008] [error] log_sql_mysql_close()
> [Fri Feb 15 14:37:28 2008] [error] mysql_query returned (1)
> [Fri Feb 15 14:37:28 2008] [error] log_sql_mysql_close()
> [Fri Feb 15 14:37:28 2008] [notice] db reconnect successful
> [Fri Feb 15 14:37:28 2008] [error] log_sql_close_link called(), db
> connected: 1
> [Fri Feb 15 14:37:28 2008] [error] log_sql_mysql_close()
> [Fri Feb 15 14:37:30 2008] [error] log_sql_close_link called(), db
> connected: 1
> [Fri Feb 15 14:37:30 2008] [error] log_sql_mysql_close()
> [Fri Feb 15 14:37:30 2008] [error] mysql_query returned (1)
> [Fri Feb 15 14:37:30 2008] [error] log_sql_mysql_close()
> [Fri Feb 15 14:37:30 2008] [notice] db reconnect successful
> [Fri Feb 15 14:37:31 2008] [error] mysql_query returned (1)
> [Fri Feb 15 14:37:31 2008] [error] log_sql_mysql_close()
> [Fri Feb 15 14:37:31 2008] [notice] db reconnect successful
> [Fri Feb 15 14:37:33 2008] [error] log_sql_close_link called(), db
> connected: 1
> [Fri Feb 15 14:37:33 2008] [error] log_sql_mysql_close()
> [Fri Feb 15 14:37:34 2008] [error] log_sql_close_link called(), db
> connected: 1
> [Fri Feb 15 14:37:34 2008] [error] log_sql_mysql_close()
> [Fri Feb 15 14:37:34 2008] [error] mysql_query returned (1)
> [Fri Feb 15 14:37:34 2008] [error] log_sql_mysql_close()
> [Fri Feb 15 14:37:34 2008] [notice] db reconnect successful
>
> 8<--------------------------------------------------------------------
>
> What I realized is, that apr_pool_cleanup_register gets
> log_sql_close_links in both cleanup_hooks:
>
> static void log_sql_child_init(apr_pool_t *p, server_rec *s)
> {
> /* ... */
> apr_pool_cleanup_register(p, NULL, log_sql_close_link,  
> log_sql_close_link);
> /* ... */
> }
>
> I changed the second log_sql_close_link to apt_pool_cleanup_null and
> everything seemed to work well.
>
> No connection gets broken during several requests, only when spare
> workers get assimilated.
> The mysqladmin processlist is now smaller and one can see that
> connections to the mysql-server indeed get reused, which wasn't the  
> case
> before.
>
> Can anyone verify that behavior of apr_pool_cleanup_register() and  
> agree
> with me?
>
> with kind regards,
> Robert Schulze
> _______________________________________________
> Download the latest version at http://www.outoforder.cc/projects/ 
> apache/mod_log_sql/
>
> To unsubscribe send an e-mail to
> mod_log_sql-unsubscribe at lists.outoforder.cc




More information about the Mod_log_sql mailing list